feat: v1.3.4 return error codes

This commit is contained in:
2022-08-05 23:22:17 +08:00
parent 5aadb3f082
commit 623f8fb585
5 changed files with 8 additions and 4 deletions

View File

@@ -85,6 +85,7 @@ impl Command for CommandImpl {
}
} else {
warning!("YubiKey not found");
return Ok(Some(1));
}
Ok(None)

View File

@@ -58,6 +58,7 @@ impl Command for CommandImpl {
}
} else {
warning!("YubiKey not found");
return Ok(Some(1));
}
Ok(None)

View File

@@ -42,8 +42,10 @@ impl DefaultCommandImpl {
}
fn main() {
if let Err(e) = inner_main() {
failure_and_exit!("Run cli error: {}", e);
match inner_main() {
Err(e) => failure_and_exit!("Run cli error: {}", e),
Ok(Some(code)) => std::process::exit(code),
Ok(None) => (),
}
}