Skip to content

Commit

Permalink
added -v flag to algokey (#4004)
Browse files Browse the repository at this point in the history
  • Loading branch information
algoganesh authored May 18, 2022
1 parent 8455403 commit aae5ef2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/algokey/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,21 @@ import (

"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"

"github.com/algorand/go-algorand/config"
)

var versionCheck bool

var rootCmd = &cobra.Command{
Use: "algokey",
Short: "CLI for managing Algorand keys",
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
if versionCheck {
fmt.Println(config.FormatVersionAndLicense())
return
}
// If no arguments passed, we should fallback to help
cmd.HelpFunc()(cmd, args)
},
Expand All @@ -41,6 +49,7 @@ func init() {
rootCmd.AddCommand(signCmd)
rootCmd.AddCommand(multisigCmd)
rootCmd.AddCommand(partCmd)
rootCmd.Flags().BoolVarP(&versionCheck, "version", "v", false, "Display and write current build version and exit")
}

func main() {
Expand Down

0 comments on commit aae5ef2

Please sign in to comment.