summaryrefslogtreecommitdiffstats
path: root/src/key_command/impl_from_str.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/key_command/impl_from_str.rs')
-rw-r--r--src/key_command/impl_from_str.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/key_command/impl_from_str.rs b/src/key_command/impl_from_str.rs
index f358e3e..9507305 100644
--- a/src/key_command/impl_from_str.rs
+++ b/src/key_command/impl_from_str.rs
@@ -336,6 +336,15 @@ impl std::str::FromStr for Command {
format!("{}: {}", command, e),
)),
}
+ } else if command == CMD_NUMBERED_COMMAND {
+ let c = arg.chars().next();
+ match c {
+ Some(c) => Ok(Self::NumberedCommand(c)),
+ None => Err(JoshutoError::new(
+ JoshutoErrorKind::InvalidParameters,
+ format!("{}: no starting character given", command),
+ )),
+ }
} else {
Err(JoshutoError::new(
JoshutoErrorKind::UnrecognizedCommand,