From 7adb0a6cc66c8f194f4aef4b7ffd64b769ee0390 Mon Sep 17 00:00:00 2001 From: Gabriel Parreiras Date: Tue, 19 Nov 2024 13:16:42 +0000 Subject: [PATCH] Use hyphens instead of underscores for new flags Signed-off-by: Gabriel Parreiras --- go/cmd/mysqlctl/command/root.go | 2 +- go/cmd/mysqlctld/cli/mysqlctld.go | 2 +- go/vt/mysqlctl/mycnf_flag.go | 2 +- go/vt/vttest/local_cluster.go | 2 +- go/vt/vttest/mysqlctl.go | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go/cmd/mysqlctl/command/root.go b/go/cmd/mysqlctl/command/root.go index 524828fef76..d8867db703d 100644 --- a/go/cmd/mysqlctl/command/root.go +++ b/go/cmd/mysqlctl/command/root.go @@ -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.") diff --git a/go/cmd/mysqlctld/cli/mysqlctld.go b/go/cmd/mysqlctld/cli/mysqlctld.go index 1710868b508..33c803c7bee 100644 --- a/go/cmd/mysqlctld/cli/mysqlctld.go +++ b/go/cmd/mysqlctld/cli/mysqlctld.go @@ -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") diff --git a/go/vt/mysqlctl/mycnf_flag.go b/go/vt/mysqlctl/mycnf_flag.go index b66910ffe73..e7d0dc337fd 100644 --- a/go/vt/mysqlctl/mycnf_flag.go +++ b/go/vt/mysqlctl/mycnf_flag.go @@ -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") @@ -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") }) } diff --git a/go/vt/vttest/local_cluster.go b/go/vt/vttest/local_cluster.go index 26c880b1976..f920c400db4 100644 --- a/go/vt/vttest/local_cluster.go +++ b/go/vt/vttest/local_cluster.go @@ -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", ""), } diff --git a/go/vt/vttest/mysqlctl.go b/go/vt/vttest/mysqlctl.go index 91eddfd74c6..8fe367771f6 100644 --- a/go/vt/vttest/mysqlctl.go +++ b/go/vt/vttest/mysqlctl.go @@ -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, @@ -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", ) @@ -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", )