Port over the kill command from nushell (#381)

* Port over the kill command from nushell

* Update formatting

* Improve error message by combining signal spans
This commit is contained in:
Andrew
2021-11-29 19:21:55 +01:00
committed by GitHub
parent bab8f6bd28
commit 5de12da765
4 changed files with 162 additions and 0 deletions

View File

@ -46,6 +46,16 @@ impl Call {
None
}
pub fn get_named_arg(&self, flag_name: &str) -> Option<Spanned<String>> {
for name in &self.named {
if flag_name == name.0.item {
return Some(name.0.clone());
}
}
None
}
pub fn nth(&self, pos: usize) -> Option<Expression> {
self.positional.get(pos).cloned()
}