enable version subcmd and --version flag for root cmd and all subcmds

This commit is contained in:
1138-4EB committed 2019-01-08 16:20:23 +01:00
1 parent ef56112711
commit b4708348c6
8 files changed
+51 -28

No files matched your search

+5 -4
View File
@@ -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)