From f831123db01446f4af8b00de17f592b428fa35da Mon Sep 17 00:00:00 2001 From: "vitess-bot[bot]" <108069721+vitess-bot[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 01:26:31 +0530 Subject: [PATCH] Fix some binaries to print the versions (#15306) Signed-off-by: Manan Gupta --- go/cmd/mysqlctld/cli/mysqlctld.go | 1 + go/cmd/topo2topo/cli/topo2topo.go | 1 + go/cmd/vtexplain/cli/vtexplain.go | 1 + go/cmd/vttestserver/cli/main.go | 1 + go/cmd/zkctld/cli/zkctld.go | 1 + go/flags/endtoend/zkctld.txt | 3 ++- 6 files changed, 7 insertions(+), 1 deletion(-) diff --git a/go/cmd/mysqlctld/cli/mysqlctld.go b/go/cmd/mysqlctld/cli/mysqlctld.go index 6ebaa5dc422..db0a3c1e25a 100644 --- a/go/cmd/mysqlctld/cli/mysqlctld.go +++ b/go/cmd/mysqlctld/cli/mysqlctld.go @@ -64,6 +64,7 @@ var ( --mysql_port=17100 \ --socket_file=/path/to/socket_file`, Args: cobra.NoArgs, + Version: servenv.AppVersion.String(), PreRunE: servenv.CobraPreRunE, RunE: run, } diff --git a/go/cmd/topo2topo/cli/topo2topo.go b/go/cmd/topo2topo/cli/topo2topo.go index 6e7e173872b..0fd553954a9 100644 --- a/go/cmd/topo2topo/cli/topo2topo.go +++ b/go/cmd/topo2topo/cli/topo2topo.go @@ -51,6 +51,7 @@ var ( It can also be used to compare data between two topologies.`, Args: cobra.NoArgs, PreRunE: servenv.CobraPreRunE, + Version: servenv.AppVersion.String(), RunE: run, } ) diff --git a/go/cmd/vtexplain/cli/vtexplain.go b/go/cmd/vtexplain/cli/vtexplain.go index 045b3f77e87..3c5c8c04791 100644 --- a/go/cmd/vtexplain/cli/vtexplain.go +++ b/go/cmd/vtexplain/cli/vtexplain.go @@ -85,6 +85,7 @@ If no keyspace name is present, VTExplain will return the following error: "```\nvtexplain -- -shards 128 --vschema-file vschema.json --schema-file schema.sql --replication-mode \"ROW\" --output-mode text --sql \"INSERT INTO users (user_id, name) VALUES(1, 'john')\"\n```\n", Args: cobra.NoArgs, PreRunE: servenv.CobraPreRunE, + Version: servenv.AppVersion.String(), RunE: run, } ) diff --git a/go/cmd/vttestserver/cli/main.go b/go/cmd/vttestserver/cli/main.go index f9a2f16cd87..8b990d2d09a 100644 --- a/go/cmd/vttestserver/cli/main.go +++ b/go/cmd/vttestserver/cli/main.go @@ -104,6 +104,7 @@ func New() (cmd *cobra.Command) { Short: "vttestserver allows users to spawn a self-contained Vitess server for local testing/CI.", Args: cobra.NoArgs, PreRunE: servenv.CobraPreRunE, + Version: servenv.AppVersion.String(), RunE: run, } diff --git a/go/cmd/zkctld/cli/zkctld.go b/go/cmd/zkctld/cli/zkctld.go index 101f1013722..5ac3520868e 100644 --- a/go/cmd/zkctld/cli/zkctld.go +++ b/go/cmd/zkctld/cli/zkctld.go @@ -41,6 +41,7 @@ var ( Use: "zkctld", Short: "zkctld is a daemon that starts or initializes ZooKeeper with Vitess-specific configuration. It will stay running as long as the underlying ZooKeeper server, and will pass along SIGTERM.", Args: cobra.NoArgs, + Version: servenv.AppVersion.String(), PersistentPreRunE: servenv.CobraPreRunE, PostRun: func(cmd *cobra.Command, args []string) { logutil.Flush() diff --git a/go/flags/endtoend/zkctld.txt b/go/flags/endtoend/zkctld.txt index d808bd7ce67..20371e9e2d7 100644 --- a/go/flags/endtoend/zkctld.txt +++ b/go/flags/endtoend/zkctld.txt @@ -4,4 +4,5 @@ Usage: zkctld [flags] Flags: - -h, --help help for zkctld + -h, --help help for zkctld + -v, --version version for zkctld