From bb1606cbc67e551f7806779b247e95c9dc6d766f Mon Sep 17 00:00:00 2001 From: Josh Harshman Date: Fri, 16 Jun 2023 10:39:39 -0600 Subject: [PATCH] Add version command to return version information. --- main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.go b/main.go index 222eb89..703240f 100644 --- a/main.go +++ b/main.go @@ -23,10 +23,19 @@ connecting from and keeps your development VM firewall rule up to date with that PersistentPreRunE: auth.Auth(), } + versionCmd := &cobra.Command{ + Use: "version", + Short: "Display version information", + Run: func(cmd *cobra.Command, args []string) { + fmt.Println(version) + }, + } + rootCmd.AddCommand(cmd.Initialize()) rootCmd.AddCommand(cmd.Update()) rootCmd.AddCommand(cmd.List()) rootCmd.AddCommand(cmd.Sync()) + rootCmd.AddCommand(versionCmd) if err := rootCmd.Execute(); err != nil { fmt.Fprintln(os.Stderr, err)