mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 04:45:04 +02:00
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:
@ -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)]
|
||||
|
Reference in New Issue
Block a user