Skip to content

Commit

Permalink
Add version command to return version information.
Browse files Browse the repository at this point in the history
  • Loading branch information
jharshman committed Jun 16, 2023
1 parent 35cdf84 commit bb1606c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bb1606c

Please sign in to comment.