2024-04-10 12:31:29 +02:00
|
|
|
use crate::command::{CommandSequence, UnixProgram};
|
|
|
|
|
2024-04-10 16:43:01 +02:00
|
|
|
pub fn parse_command_line(line: String) -> Option<CommandSequence> {
|
|
|
|
let argv: Vec<String> = line.split_whitespace().map(|s| s.to_string()).collect();
|
2024-04-10 12:31:29 +02:00
|
|
|
|
2024-04-10 16:43:01 +02:00
|
|
|
if !argv.is_empty() {
|
|
|
|
let _command = UnixProgram::new().argv(argv);
|
|
|
|
let command_sequence = CommandSequence::new();
|
|
|
|
// command_sequence.add(_command);
|
|
|
|
Some(command_sequence)
|
|
|
|
} else {
|
|
|
|
None
|
|
|
|
}
|
2024-04-10 12:31:29 +02:00
|
|
|
}
|