Skip to content
Permalink
Browse files

Use 'k' for keyset-file shorthand (#1293)

Viper has added a new restriction on the shorthand flags that
limit the shorthand to one character.
  • Loading branch information...
gdbelvin committed Jun 6, 2019
1 parent 2712830 commit a0ed60a07f8e29bd539dfb11f169546b465a6388
@@ -55,7 +55,7 @@ func init() {
hammerCmd.Flags().IntVar(&maxWorkers, "workers", 1000, "Number of parallel workers. Best when workers = QPS * timeout")
hammerCmd.Flags().IntVar(&maxOperations, "operations", 10000, "Number of operations")
hammerCmd.Flags().StringVarP(&masterPassword, "password", "p", "", "The master key to the local keyset")
hammerCmd.Flags().StringVarP(&keysetFile, "keyset-file", "kf", defaultKeysetFile, "Keyset file name and path")
hammerCmd.Flags().StringVarP(&keysetFile, "keyset-file", "k", defaultKeysetFile, "Keyset file name and path")
}

// hammerCmd represents the post command
@@ -117,6 +117,6 @@ func init() {
keysCmd.PersistentFlags().StringVarP(&masterPassword, "password", "p", "", "The master key to the local keyset")

createCmd.Flags().StringVar(&keyType, "key-type", "P256", "Type of keys to generate: [P256, P384, P521]")
createCmd.Flags().StringVarP(&keysetFile, "keyset-file", "kf", defaultKeysetFile, "Keyset file name and path")
listCmd.Flags().StringVarP(&keysetFile, "keyset-file", "kf", defaultKeysetFile, "Keyset file name and path")
createCmd.Flags().StringVarP(&keysetFile, "keyset-file", "k", defaultKeysetFile, "Keyset file name and path")
listCmd.Flags().StringVarP(&keysetFile, "keyset-file", "k", defaultKeysetFile, "Keyset file name and path")
}
@@ -120,7 +120,7 @@ func init() {

postCmd.PersistentFlags().StringVarP(&masterPassword, "password", "p", "", "The master key to the local keyset")
postCmd.PersistentFlags().StringP("secret", "s", "", "Path to client secret json")
postCmd.Flags().StringVarP(&keysetFile, "keyset-file", "kf", defaultKeysetFile, "Keyset file name and path")
postCmd.Flags().StringVarP(&keysetFile, "keyset-file", "k", defaultKeysetFile, "Keyset file name and path")
if err := viper.BindPFlag("client-secret", postCmd.PersistentFlags().Lookup("secret")); err != nil {
log.Fatalf("%v", err)
}

0 comments on commit a0ed60a

Please sign in to comment.
You can’t perform that action at this time.