|
|
|
@ -17,7 +17,7 @@ impl Protocol { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
pub fn move_state(&mut self, input : &str) -> Result<&'static str, &'static str> { |
|
|
|
pub fn parse(&mut self, input : &str) -> Result<&'static str, &'static str> { |
|
|
|
let arguments:Vec<&str> = input.split_whitespace().collect(); |
|
|
|
if arguments.len() < 1 { |
|
|
|
return Err("No argument found!"); |
|
|
|
@ -43,6 +43,11 @@ impl Protocol { |
|
|
|
//exit program
|
|
|
|
println!("Closing connection and shut down server"); |
|
|
|
} |
|
|
|
_ => { |
|
|
|
println!("Err: Command not found"); |
|
|
|
return Err("Command not found\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
Ok("OK") |
|
|
|
} |
|
|
|
} |