summaryrefslogtreecommitdiffstats
path: root/src/parse.rs
diff options
context:
space:
mode:
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)]