diff --git a/cmd/root.go b/cmd/root.go index b21e22d..3b0d4f0 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -74,13 +74,13 @@ func Execute() { func init() { currentUser, _ = user.Current() cobra.OnInitialize(InitializeConfig) - rootCmd.PersistentFlags().IntVar(&concurrency, "concurrency", -1, "set the number of concurrent processes") - rootCmd.PersistentFlags().IntVar(&timeout, "timeout", 5, "set the timeout") - rootCmd.PersistentFlags().StringVarP(&configPath, "config", "c", "", "set the config file path") - rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "set to enable/disable verbose output") - rootCmd.PersistentFlags().BoolVarP(&debug, "debug", "d", false, "set to enable/disable debug messages") - rootCmd.PersistentFlags().StringVar(&accessToken, "access-token", "", "set the access token") - rootCmd.PersistentFlags().StringVar(&cachePath, "cache", fmt.Sprintf("/tmp/%s/magellan/assets.db", currentUser.Username), "set the scanning result cache path") + rootCmd.PersistentFlags().IntVar(&concurrency, "concurrency", -1, "Set the number of concurrent processes") + rootCmd.PersistentFlags().IntVar(&timeout, "timeout", 5, "Set the timeout for requests") + rootCmd.PersistentFlags().StringVarP(&configPath, "config", "c", "", "Set the config file path") + rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "Set to enable/disable verbose output") + rootCmd.PersistentFlags().BoolVarP(&debug, "debug", "d", false, "Set to enable/disable debug messages") + rootCmd.PersistentFlags().StringVar(&accessToken, "access-token", "", "Set the access token") + rootCmd.PersistentFlags().StringVar(&cachePath, "cache", fmt.Sprintf("/tmp/%s/magellan/assets.db", currentUser.Username), "Set the scanning result cache path") // bind viper config flags with cobra checkBindFlagError(viper.BindPFlag("concurrency", rootCmd.PersistentFlags().Lookup("concurrency"))) diff --git a/cmd/version.go b/cmd/version.go index 3ffff17..b9cfd82 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -14,16 +14,17 @@ var ( ) var versionCmd = &cobra.Command{ - Use: "version", + Use: "version", + Short: "Print version info and exit", Run: func(cmd *cobra.Command, args []string) { if cmd.Flag("commit").Value.String() == "true" { output = commit if date != "" { - output += " built @ " + date + output += " built on " + date } fmt.Println(output) } else { - fmt.Println(version) + fmt.Printf("%s-%s\n", version, commit) } }, }