summaryrefslogtreecommitdiffstats
path: root/src/parse.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse.rs')
-rw-r--r--src/parse.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/parse.rs b/src/parse.rs
new file mode 100644
index 0000000..84e8daa
--- /dev/null
+++ b/src/parse.rs
@@ -0,0 +1,8 @@
+pub fn cmd(full_cmd: &str) -> (String, Vec<String>) {
+ let mut parts = full_cmd.split(' ');
+ let cmd = parts.next().unwrap();
+ (
+ cmd.to_string(),
+ parts.map(std::string::ToString::to_string).collect(),
+ )
+}