mirror of
https://github.com/nushell/nushell.git
synced 2025-08-19 16:06:12 +02:00
Make get_full_help
take &dyn Command
(#12903)
# Description Changes `get_full_help` to take a `&dyn Command` instead of multiple arguments (`&Signature`, `&Examples` `is_parser_keyword`). All of these arguments can be gathered from a `Command`, so there is no need to pass the pieces to `get_full_help`. This PR also fixes an issue where the search terms are not shown if `--help` is used on a command.
This commit is contained in:
@@ -54,8 +54,7 @@ fn in_and_if_else() -> TestResult {
|
||||
|
||||
#[test]
|
||||
fn help_works_with_missing_requirements() -> TestResult {
|
||||
let expected_length = "70";
|
||||
run_test(r#"each --help | lines | length"#, expected_length)
|
||||
run_test(r#"each --help | lines | length"#, "72")
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -65,12 +64,12 @@ fn scope_variable() -> TestResult {
|
||||
"int",
|
||||
)
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[case("a", "<> nothing")]
|
||||
#[case("b", "<1.23> float")]
|
||||
#[case("flag1", "<> nothing")]
|
||||
#[case("flag2", "<4.56> float")]
|
||||
|
||||
fn scope_command_defaults(#[case] var: &str, #[case] exp_result: &str) -> TestResult {
|
||||
run_test(
|
||||
&format!(
|
||||
|
Reference in New Issue
Block a user