summaryrefslogtreecommitdiffstats
path: root/src/parse.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-12-25 21:13:57 -0500
committerJesse Luehrs <doy@tozt.net>2021-12-25 21:13:57 -0500
commit1268ba1b83adc34cf41d89ef89753f7e13726d4e (patch)
treed6c5e73360abd2864d3e91587a80025d23fb677c /src/parse.rs
parent40e9f56d257487ecb01b7cd5fbd34409ad460eb0 (diff)
downloadnbsh-1268ba1b83adc34cf41d89ef89753f7e13726d4e.tar.gz
nbsh-1268ba1b83adc34cf41d89ef89753f7e13726d4e.zip
implement and and or as builtins
Diffstat (limited to 'src/parse.rs')
-rw-r--r--src/parse.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/parse.rs b/src/parse.rs
index 69b5135..dc0ec0a 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -50,6 +50,13 @@ impl Exe {
pub fn args(&self) -> impl Iterator<Item = &str> {
self.args.iter().map(|arg| arg.word.as_ref())
}
+
+ pub fn shift(&self) -> Self {
+ let mut new = self.clone();
+ let new_exe = new.args.remove(0);
+ new.exe = new_exe;
+ new
+ }
}
#[derive(Debug, Clone)]