diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index acb6df2..99b755d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,7 +22,7 @@ fn main_inner() -> Result<(), ShackleError> { let args = Args::parse(); match args.command { Some(user_input) => { - run_command(user_input)?; + run_command(&user_input)?; } None => { run_interactive_loop()?; @@ -36,9 +36,10 @@ fn run_interactive_loop() -> Result<(), ShackleError> { let mut rl = DefaultEditor::new()?; loop { let readline = rl.readline("> "); - match readline { + match readline.as_ref().map(|user_input| user_input.trim()) { + Ok("") => {} Ok(user_input) => { - rl.add_history_entry(user_input.as_str())?; + rl.add_history_entry(user_input)?; match run_command(user_input) { Ok(control_flow) => { if control_flow.is_break() { |