Fix subcommands column on help commands
(#2584)
This commit is contained in:
parent
332e12ded0
commit
7a595827f1
|
@ -107,7 +107,6 @@ async fn help(args: CommandArgs, registry: &CommandRegistry) -> Result<OutputStr
|
||||||
.as_string()?,
|
.as_string()?,
|
||||||
);
|
);
|
||||||
|
|
||||||
//ReturnSuccess::value(dict.into_value())
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,9 +117,10 @@ async fn help(args: CommandArgs, registry: &CommandRegistry) -> Result<OutputStr
|
||||||
rest: Vec<Tagged<String>>,
|
rest: Vec<Tagged<String>>,
|
||||||
name: Tag,
|
name: Tag,
|
||||||
) -> Result<Value, ShellError> {
|
) -> Result<Value, ShellError> {
|
||||||
let (matching, not_matching) = subcommand_names
|
let (matching, not_matching) =
|
||||||
.drain(..)
|
subcommand_names.drain(..).partition(|subcommand_name| {
|
||||||
.partition(|subcommand_name| subcommand_name.starts_with(cmd_name));
|
subcommand_name.starts_with(&format!("{} ", cmd_name))
|
||||||
|
});
|
||||||
*subcommand_names = not_matching;
|
*subcommand_names = not_matching;
|
||||||
Ok(if !matching.is_empty() {
|
Ok(if !matching.is_empty() {
|
||||||
UntaggedValue::table(
|
UntaggedValue::table(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user