diff --git a/crates/nu-cli/src/commands/help.rs b/crates/nu-cli/src/commands/help.rs index 3a12abe374..879e4ee467 100644 --- a/crates/nu-cli/src/commands/help.rs +++ b/crates/nu-cli/src/commands/help.rs @@ -107,7 +107,6 @@ async fn help(args: CommandArgs, registry: &CommandRegistry) -> Result Result>, name: Tag, ) -> Result { - let (matching, not_matching) = subcommand_names - .drain(..) - .partition(|subcommand_name| subcommand_name.starts_with(cmd_name)); + let (matching, not_matching) = + subcommand_names.drain(..).partition(|subcommand_name| { + subcommand_name.starts_with(&format!("{} ", cmd_name)) + }); *subcommand_names = not_matching; Ok(if !matching.is_empty() { UntaggedValue::table(