Reorder help <keyword> priority (#7929)

# Description

`help <keyword>` will now search for `<keyword>` in aliases first, then
commands. This matches the way the parser resolves aliases before
commands.

# User-Facing Changes

Not significant
This commit is contained in:
Jakub Žádník
2023-02-06 00:51:09 +02:00
committed by GitHub
parent aef88aa03e
commit e8d930f659
2 changed files with 16 additions and 4 deletions

View File

@ -342,3 +342,15 @@ fn help_modules_main_2() {
assert_eq!(actual.out, "spam");
}
#[test]
fn help_alias_before_command() {
let code = &[
"alias SPAM = print 'spam'",
"def SPAM [] { 'spam' }",
"help SPAM",
];
let actual = nu!(cwd: ".", nu_repl_code(code));
assert!(actual.out.contains("Alias"));
}