Properly redirect invocations (#2070)

* Properly redirect invocations

* Don't convert with-env yet, as there's a random test failure
This commit is contained in:
Jonathan Turner
2020-06-28 09:04:57 +12:00
committed by GitHub
parent 8b3964f518
commit dffc9c9b1c
5 changed files with 45 additions and 4 deletions

View File

@ -200,6 +200,28 @@ impl Block {
commands.expand_it_usage();
}
}
pub fn set_is_last(&mut self, is_last: bool) {
if let Some(pipeline) = self.block.last_mut() {
if let Some(command) = pipeline.list.last_mut() {
if let ClassifiedCommand::Internal(internal) = command {
internal.args.is_last = is_last;
}
}
}
}
pub fn get_is_last(&mut self) -> Option<bool> {
if let Some(pipeline) = self.block.last_mut() {
if let Some(command) = pipeline.list.last_mut() {
if let ClassifiedCommand::Internal(internal) = command {
return Some(internal.args.is_last);
}
}
}
None
}
}
#[derive(Debug, Ord, PartialOrd, Eq, PartialEq, Clone, Hash, Deserialize, Serialize)]