Don't require non-existent param for keygen new (#17896) (#17897)

(cherry picked from commit 22c356d24c)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
This commit is contained in:
mergify[bot]
2021-06-11 22:08:46 +00:00
committed by GitHub
parent 274a238a00
commit dc76675644

View File

@ -106,9 +106,6 @@ fn no_outfile_arg<'a, 'b>() -> Arg<'a, 'b> {
Arg::with_name(NO_OUTFILE_ARG.name) Arg::with_name(NO_OUTFILE_ARG.name)
.long(NO_OUTFILE_ARG.long) .long(NO_OUTFILE_ARG.long)
.conflicts_with_all(&["outfile", "silent"]) .conflicts_with_all(&["outfile", "silent"])
// Require a seed phrase to avoid generating a keypair
// but having no way to get the private key
.requires("use_mnemonic")
.help(NO_OUTFILE_ARG.help) .help(NO_OUTFILE_ARG.help)
} }
@ -121,7 +118,6 @@ impl KeyGenerationCommonArgs for App<'_, '_> {
self.arg(word_count_arg()) self.arg(word_count_arg())
.arg(language_arg()) .arg(language_arg())
.arg(no_passphrase_arg()) .arg(no_passphrase_arg())
.arg(no_outfile_arg())
} }
} }
@ -395,6 +391,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
.help("Do not display seed phrase. Useful when piping output to other programs that prompt for user input, like gpg"), .help("Do not display seed phrase. Useful when piping output to other programs that prompt for user input, like gpg"),
) )
.key_generation_common_args() .key_generation_common_args()
.arg(no_outfile_arg())
) )
.subcommand( .subcommand(
SubCommand::with_name("grind") SubCommand::with_name("grind")
@ -450,6 +447,12 @@ fn main() -> Result<(), Box<dyn error::Error>> {
.help("Generate using a mnemonic key phrase. Expect a significant slowdown in this mode"), .help("Generate using a mnemonic key phrase. Expect a significant slowdown in this mode"),
) )
.key_generation_common_args() .key_generation_common_args()
.arg(
no_outfile_arg()
// Require a seed phrase to avoid generating a keypair
// but having no way to get the private key
.requires("use_mnemonic")
)
) )
.subcommand( .subcommand(
SubCommand::with_name("pubkey") SubCommand::with_name("pubkey")