From 056d56b34869f11d1a926d2f2b465e9df2e21b81 Mon Sep 17 00:00:00 2001 From: Ahurac Date: Wed, 10 Apr 2024 12:31:29 +0200 Subject: [PATCH] Ajout : module `parser` --- src/parser.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/parser.rs diff --git a/src/parser.rs b/src/parser.rs new file mode 100644 index 0000000..c92a80d --- /dev/null +++ b/src/parser.rs @@ -0,0 +1,11 @@ +use crate::command::{CommandSequence, UnixProgram}; + +pub fn parse_command_line(line: String) -> CommandSequence { + let /*mut*/ command_sequence = CommandSequence::new(); + + let argv = line.split_whitespace().map(|s| s.to_string()).collect(); + let _command = UnixProgram::new().argv(argv); + // command_sequence.add(command); + + command_sequence +}