aboutsummaryrefslogtreecommitdiff
path: root/src/parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.rs')
-rw-r--r--src/parser.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/parser.rs b/src/parser.rs
new file mode 100644
index 0000000..4b37074
--- /dev/null
+++ b/src/parser.rs
@@ -0,0 +1,21 @@
+//use std::process::{Command, Stdio};
+
+// > overwrite
+// >> append
+// | pipe
+
+// && on prev cmd okay
+// || on prev cmd fail
+
+pub fn parse(line: &std::string::String) -> Vec<&str> {
+ line.split(' ').collect()
+ /* let mut pipe_append = line.split(">>").peekable();
+ if let Some(f) = pipe_append.next() {
+ println!("append to: {:?}", pipe_append.peek());
+
+ let mut commands = f.trim().split(" | ").peekable();
+ while let Some(command) = commands.next() {
+ println!("run {}", command);
+ }
+ }*/
+}