Skip to content

Commit 6b7ccd0

Browse files
Migrate remaining underscore flags to dash naming
This commit migrates the remaining underscore flags to standardized dash naming: vtbench: - unix_socket → unix-socket mysqlctl: - mysqlctl_client_protocol → mysqlctl-client-protocol vtorc: - clusters_to_watch → clusters-to-watch - shutdown_wait_time → shutdown-wait-time All flags now use the utils.SetFlag* functions for consistent naming and improved user experience. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> Signed-off-by: Rohit Nayak <[email protected]>
1 parent b3767d8 commit 6b7ccd0

File tree

4 files changed

+97
-94
lines changed

4 files changed

+97
-94
lines changed

go/cmd/vtbench/cli/vtbench.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030
"vitess.io/vitess/go/vt/grpccommon"
3131
"vitess.io/vitess/go/vt/logutil"
3232
"vitess.io/vitess/go/vt/servenv"
33+
"vitess.io/vitess/go/vt/utils"
3334
"vitess.io/vitess/go/vtbench"
3435

3536
// Import and register the gRPC vtgateconn client
@@ -139,7 +140,7 @@ func init() {
139140

140141
Main.Flags().StringVar(&host, "host", host, "VTGate host(s) in the form 'host1,host2,...'")
141142
Main.Flags().IntVar(&port, "port", port, "VTGate port")
142-
Main.Flags().StringVar(&unixSocket, "unix_socket", unixSocket, "VTGate unix socket")
143+
utils.SetFlagStringVar(Main.Flags(), &unixSocket, "unix-socket", unixSocket, "VTGate unix socket")
143144
Main.Flags().StringVar(&protocol, "protocol", protocol, "Client protocol, either mysql (default), grpc-vtgate, or grpc-vttablet")
144145
Main.Flags().StringVar(&user, "user", user, "Username to connect using mysql (password comes from the db-credentials-file)")
145146
Main.Flags().StringVar(&db, "db", db, "Database name to use when connecting / running the queries (e.g. @replica, keyspace, keyspace/shard etc)")

go/flags/endtoend/flags_analysis.json

Lines changed: 90 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -74,94 +74,94 @@
7474
}
7575
},
7676
"unique_underscore_flags": [
77-
"statsd_sample_rate",
78-
"shutdown_wait_time",
79-
"action_timeout",
80-
"mysql_ldap_auth_method",
81-
"restart_before_backup",
82-
"topocustomrule_cell",
83-
"external_topo_global_server_address",
84-
"mysql_timeout",
85-
"binlog_player_grpc_server_name",
77+
"discovery_low_replication_lag",
8678
"max_sequence_id",
87-
"external_topo_global_root",
88-
"enable_online_ddl",
89-
"transaction_mode",
90-
"min_retention_time",
79+
"mysql_auth_vault_ttl",
80+
"gateway_initial_tablet_timeout",
81+
"max_table_shard_size",
82+
"data_dir",
9183
"bind_variables",
92-
"file_backup_storage_root",
93-
"tablet_config",
94-
"mysql_auth_vault_addr",
95-
"unix_socket",
84+
"cells_to_watch",
85+
"enable_direct_ddl",
86+
"min_retention_time",
87+
"mysql_ldap_auth_config_file",
88+
"mysql_auth_vault_timeout",
89+
"external_topo_global_server_address",
90+
"clusters_to_watch",
91+
"mysql_timeout",
92+
"mysql_auth_vault_role_secretidfile",
93+
"legacy_replication_lag_algorithm",
94+
"allow_first_backup",
9695
"use_random_sequence",
9796
"binlog_player_grpc_crl",
98-
"rng_seed",
99-
"mysql_auth_vault_role_mountpoint",
100-
"cells_to_watch",
101-
"mysql_auth_vault_path",
102-
"num_shards",
103-
"binlog_player_grpc_key",
10497
"vtgate_protocol",
105-
"min_retention_count",
106-
"rdonly_count",
98+
"mysql_auth_vault_addr",
10799
"mysql_ldap_auth_config_string",
108-
"discovery_high_replication_lag_minimum_serving",
109-
"mysql_ldap_auth_config_file",
110-
"extra_my_cnf",
111-
"vschema_ddl_authorized_users",
112-
"mysql_auth_vault_role_secretidfile",
113-
"min_number_serving_vttablets",
114-
"enable_buffer",
115-
"mysql_auth_server_static_file",
116-
"mysql_auth_vault_tls_ca",
117-
"filecustomrules_watch",
118-
"external_topo_implementation",
119-
"binlog_player_grpc_ca",
100+
"mysql_ldap_auth_method",
120101
"mysql_clientcert_auth_method",
121-
"mysql_bind_host",
122-
"data_dir",
123-
"null_probability",
124-
"gateway_initial_tablet_timeout",
125-
"enable_direct_ddl",
126-
"min_sequence_id",
127-
"max_table_shard_size",
128-
"replica_count",
129-
"mysqlctl_client_protocol",
102+
"log_dir",
130103
"log_link",
131-
"log_queries",
132-
"log_backtrace_at",
133104
"enable_system_settings",
134-
"mysql_auth_server_static_string",
135-
"default_schema_dir",
136-
"initial_backup",
137-
"persistent_mode",
138-
"binlog_player_grpc_cert",
139-
"mysql_auth_vault_timeout",
140-
"discovery_low_replication_lag",
105+
"log_queries",
106+
"min_sequence_id",
107+
"rng_seed",
141108
"min_table_shard_size",
142-
"mysql_auth_vault_tokenfile",
143-
"mysql_auth_static_reload_interval",
109+
"replica_count",
110+
"statsd_sample_rate",
111+
"enable_buffer",
144112
"min_backup_interval",
145-
"default_tablet_type",
113+
"mysql_auth_server_static_string",
146114
"topocustomrule_path",
147-
"legacy_replication_lag_algorithm",
115+
"binlog_player_grpc_cert",
116+
"extra_my_cnf",
117+
"vschema_ddl_authorized_users",
118+
"null_probability",
119+
"mysql_auth_vault_tls_ca",
120+
"statsd_address",
121+
"persistent_mode",
122+
"initial_backup",
123+
"action_timeout",
124+
"mysql_auth_vault_path",
148125
"mysql_auth_vault_roleid",
149-
"log_dir",
150-
"allow_first_backup",
151-
"mysql_auth_vault_ttl",
152-
"mysql_only",
153-
"incremental_from_pos",
154-
"clusters_to_watch",
126+
"shutdown_wait_time",
127+
"external_topo_implementation",
155128
"snapshot_file",
156-
"statsd_address"
129+
"mysql_auth_server_static_file",
130+
"filecustomrules_watch",
131+
"mysql_auth_vault_tokenfile",
132+
"incremental_from_pos",
133+
"default_tablet_type",
134+
"min_retention_count",
135+
"mysql_auth_static_reload_interval",
136+
"log_backtrace_at",
137+
"file_backup_storage_root",
138+
"restart_before_backup",
139+
"mysql_bind_host",
140+
"rdonly_count",
141+
"external_topo_global_root",
142+
"discovery_high_replication_lag_minimum_serving",
143+
"enable_online_ddl",
144+
"num_shards",
145+
"default_schema_dir",
146+
"transaction_mode",
147+
"unix_socket",
148+
"mysql_only",
149+
"binlog_player_grpc_server_name",
150+
"mysql_auth_vault_role_mountpoint",
151+
"binlog_player_grpc_ca",
152+
"min_number_serving_vttablets",
153+
"mysqlctl_client_protocol",
154+
"topocustomrule_cell",
155+
"tablet_config",
156+
"binlog_player_grpc_key"
157157
],
158158
"flag_to_binaries": {
159159
"allow_first_backup": [
160160
"vtbackup"
161161
],
162162
"file_backup_storage_root": [
163-
"vttablet",
164163
"vtctld",
164+
"vttablet",
165165
"vtbackup"
166166
],
167167
"incremental_from_pos": [
@@ -171,32 +171,32 @@
171171
"vtbackup"
172172
],
173173
"log_backtrace_at": [
174-
"vtcombo",
175174
"vtorc",
176-
"vtbench",
177175
"vtclient",
178176
"vttablet",
179-
"mysqlctl",
177+
"mysqlctld",
178+
"vtbackup",
180179
"vttestserver",
181-
"vtgate",
182180
"vtctld",
183-
"mysqlctld",
181+
"vtcombo",
184182
"vtctldclient",
185-
"vtbackup"
183+
"vtgate",
184+
"vtbench",
185+
"mysqlctl"
186186
],
187187
"log_dir": [
188-
"vtcombo",
189188
"vtorc",
190-
"vtbench",
191189
"vtclient",
192190
"vttablet",
193-
"mysqlctl",
191+
"mysqlctld",
192+
"vtbackup",
194193
"vttestserver",
195-
"vtgate",
196194
"vtctld",
197-
"mysqlctld",
195+
"vtcombo",
198196
"vtctldclient",
199-
"vtbackup"
197+
"vtgate",
198+
"vtbench",
199+
"mysqlctl"
200200
],
201201
"min_backup_interval": [
202202
"vtbackup"
@@ -214,9 +214,9 @@
214214
"vtbackup"
215215
],
216216
"action_timeout": [
217-
"vtctldclient",
218217
"vtctld",
219-
"vtcombo"
218+
"vtcombo",
219+
"vtctldclient"
220220
],
221221
"log_link": [
222222
"vtctldclient"
@@ -242,18 +242,18 @@
242242
"vtgate"
243243
],
244244
"enable_direct_ddl": [
245-
"vttestserver",
246245
"vtcombo",
246+
"vttestserver",
247247
"vtgate"
248248
],
249249
"enable_online_ddl": [
250-
"vttestserver",
251250
"vtcombo",
251+
"vttestserver",
252252
"vtgate"
253253
],
254254
"enable_system_settings": [
255-
"vttestserver",
256255
"vtcombo",
256+
"vttestserver",
257257
"vtgate"
258258
],
259259
"gateway_initial_tablet_timeout": [
@@ -314,21 +314,21 @@
314314
"vtgate"
315315
],
316316
"statsd_address": [
317-
"vtgate",
318-
"vttablet"
317+
"vttablet",
318+
"vtgate"
319319
],
320320
"statsd_sample_rate": [
321-
"vtgate",
322-
"vttablet"
321+
"vttablet",
322+
"vtgate"
323323
],
324324
"transaction_mode": [
325-
"vttestserver",
326325
"vtcombo",
326+
"vttestserver",
327327
"vtgate"
328328
],
329329
"vschema_ddl_authorized_users": [
330-
"vttestserver",
331330
"vtcombo",
331+
"vttestserver",
332332
"vtgate"
333333
],
334334
"clusters_to_watch": [

go/vt/mysqlctl/mysqlctlclient/interface.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"vitess.io/vitess/go/vt/log"
2828
mysqlctlpb "vitess.io/vitess/go/vt/proto/mysqlctl"
2929
"vitess.io/vitess/go/vt/servenv"
30+
"vitess.io/vitess/go/vt/utils"
3031
)
3132

3233
var protocol = "grpc"
@@ -36,7 +37,7 @@ func init() {
3637
}
3738

3839
func registerFlags(fs *pflag.FlagSet) {
39-
fs.StringVar(&protocol, "mysqlctl_client_protocol", protocol, "the protocol to use to talk to the mysqlctl server")
40+
utils.SetFlagStringVar(fs, &protocol, "mysqlctl-client-protocol", protocol, "the protocol to use to talk to the mysqlctl server")
4041
}
4142

4243
// MysqlctlClient defines the interface used to send remote mysqlctl commands

go/vt/vtorc/logic/tablet_discovery.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import (
3737
topodatapb "vitess.io/vitess/go/vt/proto/topodata"
3838
"vitess.io/vitess/go/vt/topo"
3939
"vitess.io/vitess/go/vt/topo/topoproto"
40+
"vitess.io/vitess/go/vt/utils"
4041
"vitess.io/vitess/go/vt/vtorc/config"
4142
"vitess.io/vitess/go/vt/vtorc/db"
4243
"vitess.io/vitess/go/vt/vtorc/inst"
@@ -117,8 +118,8 @@ func getEmergencyReparentShardDisabledStats() map[string]int64 {
117118

118119
// RegisterFlags registers the flags required by VTOrc
119120
func RegisterFlags(fs *pflag.FlagSet) {
120-
fs.StringSliceVar(&clustersToWatch, "clusters_to_watch", clustersToWatch, "Comma-separated list of keyspaces or keyspace/keyranges that this instance will monitor and repair. Defaults to all clusters in the topology. Example: \"ks1,ks2/-80\"")
121-
fs.DurationVar(&shutdownWaitTime, "shutdown_wait_time", shutdownWaitTime, "Maximum time to wait for VTOrc to release all the locks that it is holding before shutting down on SIGTERM")
121+
utils.SetFlagStringSliceVar(fs, &clustersToWatch, "clusters-to-watch", clustersToWatch, "Comma-separated list of keyspaces or keyspace/keyranges that this instance will monitor and repair. Defaults to all clusters in the topology. Example: \"ks1,ks2/-80\"")
122+
utils.SetFlagDurationVar(fs, &shutdownWaitTime, "shutdown-wait-time", shutdownWaitTime, "Maximum time to wait for VTOrc to release all the locks that it is holding before shutting down on SIGTERM")
122123
}
123124

124125
// initializeShardsToWatch parses the --clusters_to_watch flag-value

0 commit comments

Comments
 (0)