mirror of
https://github.com/nushell/nushell.git
synced 2024-11-27 02:44:01 +01:00
Merge pull request #263 from jonathandturner/defer-evaluation
get tests passing by fixing classifying external
This commit is contained in:
commit
f17c6a5a37
44
src/cli.rs
44
src/cli.rs
@ -478,30 +478,28 @@ fn classify_command(
|
||||
args,
|
||||
}))
|
||||
}
|
||||
false => match context.get_command(name).as_ref() {
|
||||
Command::Static(_command) => {
|
||||
let arg_list_strings: Vec<Spanned<String>> = match call.children() {
|
||||
//Some(args) => args.iter().map(|i| i.as_external_arg(source)).collect(),
|
||||
Some(args) => args
|
||||
.iter()
|
||||
.filter_map(|i| match i {
|
||||
TokenNode::Whitespace(_) => None,
|
||||
other => Some(Spanned::from_item(
|
||||
other.as_external_arg(source),
|
||||
other.span(),
|
||||
)),
|
||||
})
|
||||
.collect(),
|
||||
None => vec![],
|
||||
};
|
||||
false => {
|
||||
let arg_list_strings: Vec<Spanned<String>> = match call.children() {
|
||||
//Some(args) => args.iter().map(|i| i.as_external_arg(source)).collect(),
|
||||
Some(args) => args
|
||||
.iter()
|
||||
.filter_map(|i| match i {
|
||||
TokenNode::Whitespace(_) => None,
|
||||
other => Some(Spanned::from_item(
|
||||
other.as_external_arg(source),
|
||||
other.span(),
|
||||
)),
|
||||
})
|
||||
.collect(),
|
||||
None => vec![],
|
||||
};
|
||||
|
||||
Ok(ClassifiedCommand::External(ExternalCommand {
|
||||
name: name.to_string(),
|
||||
name_span: Some(head.span().clone()),
|
||||
args: arg_list_strings,
|
||||
}))
|
||||
}
|
||||
},
|
||||
Ok(ClassifiedCommand::External(ExternalCommand {
|
||||
name: name.to_string(),
|
||||
name_span: Some(head.span().clone()),
|
||||
args: arg_list_strings,
|
||||
}))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user