diff --git a/src/errors.rs b/src/errors.rs index 0def6f0..b61bdb0 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -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, } diff --git a/src/main.rs b/src/main.rs index bbdddbb..693e156 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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(