diff --git a/src/main.rs b/src/main.rs index 1a3aec1..e0c4797 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,31 +1,7 @@ -use std::io; -use std::io::Write; - -fn exit() { - println!("exit"); - std::process::exit(0); -} +mod command; +mod control; +mod interface; fn main() { - let mut user_input = String::new(); - let mut bytes_read; - - loop { - print!("$ "); - io::stdout().flush().unwrap(); - - user_input.clear(); - bytes_read = io::stdin() - .read_line(&mut user_input) - .expect("error reading user input"); - - if bytes_read == 0 { - println!(); - exit(); - } else { - let user_input = user_input.trim(); - - println!("{}", user_input); - } - } + control::run(); }