aboutsummaryrefslogtreecommitdiff
path: root/crates
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
commitdbc90250198f1eeb5607fc806f1e18c0d3f925ab (patch)
treedbf780607b0e1d046d68fe7e4725087254f9d41b /crates
parentfeat(whirl_prompt): whirl mode in fetch builtin (diff)
downloadwhirl-dbc90250198f1eeb5607fc806f1e18c0d3f925ab.tar.xz
whirl-dbc90250198f1eeb5607fc806f1e18c0d3f925ab.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.
Diffstat (limited to 'crates')
-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();
}