diff --git a/crates/nu-engine/src/documentation.rs b/crates/nu-engine/src/documentation.rs index 92f2c3b925..ef00d6cf24 100644 --- a/crates/nu-engine/src/documentation.rs +++ b/crates/nu-engine/src/documentation.rs @@ -572,7 +572,9 @@ where document_shape(arg) ); } - let _ = write!(long_desc, " - {}", flag.desc); + if !flag.desc.is_empty() { + let _ = write!(long_desc, ": {}", flag.desc); + } if let Some(value) = &flag.default_value { let _ = write!(long_desc, " (default: {})", &value_formatter(value)); } diff --git a/tests/repl/test_help.rs b/tests/repl/test_help.rs index 16d168587a..2fe3b5ecff 100644 --- a/tests/repl/test_help.rs +++ b/tests/repl/test_help.rs @@ -6,11 +6,11 @@ use rstest::rstest; #[case(": arga help")] #[case("argb help")] #[case("optional, default: 20")] -#[case("- f1 switch")] -#[case("- f2 named no default")] -#[case("- f3 named default 3")] +#[case(": f1 switch")] +#[case(": f2 named no default")] +#[case(": f3 named default 3")] #[case("default: 33")] -#[case("--help - Display the help message")] +#[case("--help: Display the help message")] fn can_get_help(#[case] exp_result: &str) -> TestResult { run_test( &format!(