Prevent --force from being used with the TUI or unexpected commands

We may want to use --force with some of these later, so we shouldn't
allow it to be a no-op at present.
This commit is contained in:
Jack Grigg
2021-05-02 09:38:31 +12:00
parent 65082edf22
commit d36da3fe2d
2 changed files with 25 additions and 1 deletions
+10
View File
@@ -6,6 +6,8 @@ use crate::util::slot_to_ui;
pub enum Error {
CustomManagementKey,
InvalidFlagCommand(String, String),
InvalidFlagTui(String),
InvalidPinLength,
InvalidPinPolicy(String),
InvalidSlot(u8),
@@ -42,6 +44,14 @@ impl fmt::Debug for Error {
Error::CustomManagementKey => {
writeln!(f, "Custom unprotected management keys are not supported.")?
}
Error::InvalidFlagCommand(flag, command) => {
writeln!(f, "Flag '{}' cannot be used with '{}'.", flag, command)?
}
Error::InvalidFlagTui(flag) => writeln!(
f,
"Flag '{}' cannot be used with the interactive interface.",
flag
)?,
Error::InvalidPinLength => writeln!(f, "The PIN needs to be 1-8 characters.")?,
Error::InvalidPinPolicy(s) => writeln!(
f,