aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-07-24 10:29:50 +0000
committerFuwn <[email protected]>2021-07-24 10:29:50 +0000
commit34c152f925db1c22b6f9aa660dcbec4d363e2ece (patch)
tree4b01e25f6894b31a257e75ef6db988315addb3ea
parentfeat(whirl_prompt): whirl mode in fetch builtin (diff)
downloadwhirl-34c152f925db1c22b6f9aa660dcbec4d363e2ece.tar.xz
whirl-34c152f925db1c22b6f9aa660dcbec4d363e2ece.zip
fix(whirl_prompt): register single char input as null
When entering inputs with a single character, the input would not register as a null command so no "command not found" error would be produced. Now it will produce the error. In the future, it would be smart to replace this mechanism with an iterator over a commands list.
-rw-r--r--crates/whirl_prompt/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/whirl_prompt/src/lib.rs b/crates/whirl_prompt/src/lib.rs
index ea703c8..44b06fc 100644
--- a/crates/whirl_prompt/src/lib.rs
+++ b/crates/whirl_prompt/src/lib.rs
@@ -75,7 +75,7 @@ impl Prompt {
.read_line(&mut input)
.expect("failed to read command from stdin");
- if input.len() <= 2 {
+ if input.len() <= 1 {
input = "null".to_string();
}