// NewHashPasswordCmd returns a new Hash Password Cmd.
funcNewHashPasswordCmd()(cmd*cobra.Command){
cmd=&cobra.Command{
Use:"hash-password [password]",
Short:"Hash a password to be used in file-based users database. Default algorithm is argon2id.",
Args:cobra.MinimumNArgs(1),
Run:cmdHashPasswordRun,
}
cmd.Flags().BoolP("sha512","z",false,fmt.Sprintf("use sha512 as the algorithm (changes iterations to %d, change with -i)",schema.DefaultPasswordSHA512Configuration.Iterations))
cmd.Flags().IntP("iterations","i",schema.DefaultPasswordConfiguration.Iterations,"set the number of hashing iterations")
cmd.Flags().StringP("salt","s","","set the salt string")
cmd.Flags().IntP("memory","m",schema.DefaultPasswordConfiguration.Memory,"[argon2id] set the amount of memory param (in MB)")
cmd.Flags().IntP("parallelism","p",schema.DefaultPasswordConfiguration.Parallelism,"[argon2id] set the parallelism param")
cmd.Flags().IntP("key-length","k",schema.DefaultPasswordConfiguration.KeyLength,"[argon2id] set the key length param")
cmd.Flags().IntP("salt-length","l",schema.DefaultPasswordConfiguration.SaltLength,"set the auto-generated salt length")