Skip to content
Snippets Groups Projects
Commit d9be91ad authored by Michael Gattozzi's avatar Michael Gattozzi
Browse files

Merged PR with local changes

parents bb6cbe50 1d622c14
No related branches found
No related tags found
No related merge requests found
...@@ -6,17 +6,20 @@ use command::*; ...@@ -6,17 +6,20 @@ use command::*;
pub fn repl() { pub fn repl() {
let mut input = String::new(); let mut input = String::new();
let _unused = io::stdin().read_line(&mut input); match io::stdin().read_line(&mut input) {
let out_wrap = run(input.trim().split_whitespace() Ok(n) => {
.collect::<Vec<&str>>().as_slice()); let out_wrap = run(input.trim().split_whitespace().collect::<Vec<&str>>());
if out_wrap.is_some() { if out_wrap.is_some() {
let out = out_wrap.unwrap(); let out = out_wrap.unwrap();
if out.stdout.is_empty() { if out.stdout.is_empty() {
println!("{}",out.stderr.trim()); println!("{}",out.stderr.trim());
} else { } else {
println!("{}",out.stdout.trim()); println!("{}",out.stdout.trim());
}
} else {
println!("{} is not a valid command", input.trim());
}
} }
} else { Err(error) => println!("Line Read Error: {}", error)
println!("{} is not a valid command", input.trim()); };
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment