You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
279 B
9 lines
279 B
pub fn parse_line(line: &str) -> (&str, Vec<&str>) {
|
|
let tokens = line.trim().split(' ').collect::<Vec<&str>>();
|
|
let mut args: Vec<&str> = Vec::new();
|
|
let command = tokens[0];
|
|
if tokens.len() > 1 {
|
|
args = tokens[1..].to_vec();
|
|
}
|
|
(command, args)
|
|
}
|