Skip to content

Commit

Permalink
Use hyphens instead of underscores for new flags
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Parreiras <[email protected]>
  • Loading branch information
gmpify committed Nov 19, 2024
1 parent da34985 commit 7adb0a6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion go/cmd/mysqlctl/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func init() {

servenv.MovePersistentFlagsToCobraCommand(Root)

Root.PersistentFlags().StringVar(&mysqlBindAddress, "mysql_bind_address", mysqlBindAddress, "MySQL bind address.")
Root.PersistentFlags().StringVar(&mysqlBindAddress, "mysql-bind-address", mysqlBindAddress, "MySQL bind address.")
Root.PersistentFlags().IntVar(&mysqlPort, "mysql_port", mysqlPort, "MySQL port.")
Root.PersistentFlags().Uint32Var(&tabletUID, "tablet_uid", tabletUID, "Tablet UID.")
Root.PersistentFlags().StringVar(&mysqlSocket, "mysql_socket", mysqlSocket, "Path to the mysqld socket file.")
Expand Down
2 changes: 1 addition & 1 deletion go/cmd/mysqlctld/cli/mysqlctld.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func init() {

servenv.MoveFlagsToCobraCommand(Main)

Main.Flags().StringVar(&mysqlBindAddress, "mysql_bind_address", mysqlBindAddress, "MySQL bind address")
Main.Flags().StringVar(&mysqlBindAddress, "mysql-bind-address", mysqlBindAddress, "MySQL bind address")
Main.Flags().IntVar(&mysqlPort, "mysql_port", mysqlPort, "MySQL port")
Main.Flags().Uint32Var(&tabletUID, "tablet_uid", tabletUID, "Tablet UID")
Main.Flags().StringVar(&mysqlSocket, "mysql_socket", mysqlSocket, "Path to the mysqld socket file")
Expand Down
2 changes: 1 addition & 1 deletion go/vt/mysqlctl/mycnf_flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ const (
func RegisterFlags() {
servenv.OnParse(func(fs *pflag.FlagSet) {
fs.IntVar(&flagServerID, "mycnf_server_id", flagServerID, "mysql server id of the server (if specified, mycnf-file will be ignored)")
fs.StringVar(&flagMysqlBindAddress, "mycnf_mysql_bin_address", flagMysqlBindAddress, "address mysql binds on")
fs.IntVar(&flagMysqlPort, "mycnf_mysql_port", flagMysqlPort, "port mysql is listening on")
fs.StringVar(&flagDataDir, "mycnf_data_dir", flagDataDir, "data directory for mysql")
fs.StringVar(&flagInnodbDataHomeDir, "mycnf_innodb_data_home_dir", flagInnodbDataHomeDir, "Innodb data home directory")
Expand All @@ -83,6 +82,7 @@ func RegisterFlags() {
fs.StringVar(&flagSecureFilePriv, "mycnf_secure_file_priv", flagSecureFilePriv, "mysql path for loading secure files")

fs.StringVar(&flagMycnfFile, "mycnf-file", flagMycnfFile, "path to my.cnf, if reading all config params from there")
fs.StringVar(&flagMysqlBindAddress, "mycnf-mysql-bin-address", flagMysqlBindAddress, "address mysql binds on")
})
}

Expand Down
2 changes: 1 addition & 1 deletion go/vt/vttest/local_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ func (db *LocalCluster) JSONConfig() any {
"port": db.vt.Port,
"socket": db.mysql.UnixSocket(),
"vtcombo_mysql_port": db.Env.PortForProtocol("vtcombo_mysql_port", ""),
"mysql_bind_address": db.vt.BindAddressMysql,
"mysql-bind-address": db.vt.BindAddressMysql,
"mysql": db.Env.PortForProtocol("mysql", ""),
}

Expand Down
6 changes: 3 additions & 3 deletions go/vt/vttest/mysqlctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (ctl *Mysqlctl) Setup() error {
ctl.Binary,
"--alsologtostderr",
"--tablet_uid", fmt.Sprintf("%d", ctl.UID),
"--mysql_bind_address", ctl.Host,
"--mysql-bind-address", ctl.Host,
"--mysql_port", fmt.Sprintf("%d", ctl.Port),
"init",
"--init_db_sql_file", ctl.InitFile,
Expand All @@ -93,7 +93,7 @@ func (ctl *Mysqlctl) Start() error {
ctl.Binary,
"--alsologtostderr",
"--tablet_uid", fmt.Sprintf("%d", ctl.UID),
"--mysql_bind_address", ctl.Host,
"--mysql-bind-address", ctl.Host,
"--mysql_port", fmt.Sprintf("%d", ctl.Port),
"start",
)
Expand All @@ -117,7 +117,7 @@ func (ctl *Mysqlctl) TearDown() error {
ctl.Binary,
"--alsologtostderr",
"--tablet_uid", fmt.Sprintf("%d", ctl.UID),
"--mysql_bind_address", ctl.Host,
"--mysql-bind-address", ctl.Host,
"--mysql_port", fmt.Sprintf("%d", ctl.Port),
"shutdown",
)
Expand Down

0 comments on commit 7adb0a6

Please sign in to comment.