Skip to content

Commit

Permalink
Merge pull request #4 from jharshman/add-version-string
Browse files Browse the repository at this point in the history
Add version command to return version information.
  • Loading branch information
jharshman committed Jun 16, 2023
2 parents 35cdf84 + bb1606c commit 2a1a080
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 2a1a080

Please sign in to comment.