mirror of
https://github.com/nushell/nushell
synced 2024-12-28 05:53:09 +00:00
get tests passing by fixing classifying external
This commit is contained in:
parent
b173fa6303
commit
80bcc51294
1 changed files with 21 additions and 23 deletions
44
src/cli.rs
44
src/cli.rs
|
@ -478,30 +478,28 @@ fn classify_command(
|
||||||
args,
|
args,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
false => match context.get_command(name).as_ref() {
|
false => {
|
||||||
Command::Static(_command) => {
|
let arg_list_strings: Vec<Spanned<String>> = match call.children() {
|
||||||
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().map(|i| i.as_external_arg(source)).collect(),
|
Some(args) => args
|
||||||
Some(args) => args
|
.iter()
|
||||||
.iter()
|
.filter_map(|i| match i {
|
||||||
.filter_map(|i| match i {
|
TokenNode::Whitespace(_) => None,
|
||||||
TokenNode::Whitespace(_) => None,
|
other => Some(Spanned::from_item(
|
||||||
other => Some(Spanned::from_item(
|
other.as_external_arg(source),
|
||||||
other.as_external_arg(source),
|
other.span(),
|
||||||
other.span(),
|
)),
|
||||||
)),
|
})
|
||||||
})
|
.collect(),
|
||||||
.collect(),
|
None => vec![],
|
||||||
None => vec![],
|
};
|
||||||
};
|
|
||||||
|
|
||||||
Ok(ClassifiedCommand::External(ExternalCommand {
|
Ok(ClassifiedCommand::External(ExternalCommand {
|
||||||
name: name.to_string(),
|
name: name.to_string(),
|
||||||
name_span: Some(head.span().clone()),
|
name_span: Some(head.span().clone()),
|
||||||
args: arg_list_strings,
|
args: arg_list_strings,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue