return better error for unimplemented subcommand
This commit is contained in:
parent
e653ac684f
commit
ed9cf91cfb
2 changed files with 3 additions and 2 deletions
|
@ -4,4 +4,6 @@ use thiserror::Error;
|
|||
pub(crate) enum UserError {
|
||||
#[error("User aborted the operation.")]
|
||||
Aborted,
|
||||
#[error("Unknown subcommand. It may need to be implemented.")]
|
||||
UnknownSubcommand,
|
||||
}
|
||||
|
|
|
@ -273,14 +273,13 @@ fn run() -> anyhow::Result<()> {
|
|||
},
|
||||
Some(s) => {
|
||||
error!("Unknown subcommand: {:?}", s);
|
||||
return Err(errors::UserError::UnknownSubcommand.into());
|
||||
},
|
||||
_ => {
|
||||
debug!("No subcommand given, assuming user wants a 2fa code");
|
||||
return do_subcmd_code(selected_accounts);
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn get_selected_accounts(
|
||||
|
|
Loading…
Reference in a new issue