summaryrefslogtreecommitdiffstats
path: root/src/parse/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse/mod.rs')
-rw-r--r--src/parse/mod.rs17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/parse/mod.rs b/src/parse/mod.rs
index 9663086..e2b7ec0 100644
--- a/src/parse/mod.rs
+++ b/src/parse/mod.rs
@@ -11,7 +11,7 @@ impl Pipeline {
}
}
-#[derive(Debug, Eq, PartialEq)]
+#[derive(Debug, Clone, Eq, PartialEq)]
pub struct Exe {
exe: std::path::PathBuf,
args: Vec<String>,
@@ -27,6 +27,16 @@ impl Exe {
&self.args
}
+ pub fn append(&mut self, other: Self) {
+ let Self {
+ exe: _exe,
+ args,
+ redirects,
+ } = other;
+ self.args.extend(args);
+ self.redirects.extend(redirects);
+ }
+
pub fn redirects(&self) -> &[Redirect] {
&self.redirects
}
@@ -107,10 +117,7 @@ pub struct Error {
impl Error {
fn new(input: String, e: pest::error::Error<ast::Rule>) -> Self {
- Self {
- input,
- e,
- }
+ Self { input, e }
}
}