enable version subcmd and --version flag for root cmd and all subcmds
This commit is contained in:
1 parent
ef56112711
commit
b4708348c6
8 files changed
+51
-28
No files matched your search
+5
-4
@@ -12,10 +12,11 @@ func init() {
|
||||
}
|
||||
|
||||
var hashCmd = &cobra.Command{
|
||||
Use: "hash <password>",
|
||||
Short: "Hashes a password",
|
||||
Long: `Hashes a password using bcrypt algorithm.`,
|
||||
Args: cobra.ExactArgs(1),
|
||||
Use: "hash <password>",
|
||||
Version: rootCmd.Version,
|
||||
Short: "Hashes a password",
|
||||
Long: `Hashes a password using bcrypt algorithm.`,
|
||||
Args: cobra.ExactArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
pwd, err := users.HashPwd(args[0])
|
||||
checkErr(err)
|
||||
|
||||
Reference in new issue
Block a user