summaryrefslogtreecommitdiffstats
path: root/src/history.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-11-13 16:58:50 -0500
committerJesse Luehrs <doy@tozt.net>2021-11-13 16:58:50 -0500
commitc5515216780c4c34914ac6086bb51298a3c44513 (patch)
treef099e583b0d851ff4536c9b350f09898cf2b27fe /src/history.rs
parent60c974b28c514f179477710810e263fabf206c89 (diff)
downloadnbsh-c5515216780c4c34914ac6086bb51298a3c44513.tar.gz
nbsh-c5515216780c4c34914ac6086bb51298a3c44513.zip
refactor
Diffstat (limited to 'src/history.rs')
-rw-r--r--src/history.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/history.rs b/src/history.rs
index 14e2594..4d1d453 100644
--- a/src/history.rs
+++ b/src/history.rs
@@ -21,7 +21,7 @@ impl History {
}
pub async fn run(&mut self, cmd: &str) -> anyhow::Result<usize> {
- let (exe, args) = parse_cmd(cmd);
+ let (exe, args) = crate::parse::cmd(cmd);
let mut process = async_std::process::Command::new(&exe);
process.args(&args);
let mut child = process
@@ -364,12 +364,3 @@ impl ExitInfo {
}
}
}
-
-fn parse_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(),
- )
-}