mirror of
https://github.com/nushell/nushell
synced 2024-12-27 05:23:11 +00:00
Do not create help for wrapped command (#11235)
Pretty self-explanatory. The commit is only one `if`. Fix #11096
This commit is contained in:
parent
fb3350ebc3
commit
05d7d6d6ad
2 changed files with 9 additions and 1 deletions
|
@ -299,3 +299,9 @@ fn def_env_wrapped() {
|
||||||
);
|
);
|
||||||
assert_eq!(actual.out, "bacon");
|
assert_eq!(actual.out, "bacon");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn def_env_wrapped_no_help() {
|
||||||
|
let actual = nu!("def --wrapped foo [...rest] { echo $rest }; foo -h | to json --raw");
|
||||||
|
assert_eq!(actual.out, r#"["-h"]"#);
|
||||||
|
}
|
||||||
|
|
|
@ -580,7 +580,9 @@ pub fn parse_def(
|
||||||
let declaration = working_set.get_decl_mut(decl_id);
|
let declaration = working_set.get_decl_mut(decl_id);
|
||||||
|
|
||||||
signature.name = name.clone();
|
signature.name = name.clone();
|
||||||
*signature = signature.add_help();
|
if !has_wrapped {
|
||||||
|
*signature = signature.add_help();
|
||||||
|
}
|
||||||
signature.usage = usage;
|
signature.usage = usage;
|
||||||
signature.extra_usage = extra_usage;
|
signature.extra_usage = extra_usage;
|
||||||
signature.allows_unknown_args = has_wrapped;
|
signature.allows_unknown_args = has_wrapped;
|
||||||
|
|
Loading…
Reference in a new issue