diff --git a/crates/nu-engine/src/documentation.rs b/crates/nu-engine/src/documentation.rs index 6d3f1b8465..d84602f9f6 100644 --- a/crates/nu-engine/src/documentation.rs +++ b/crates/nu-engine/src/documentation.rs @@ -105,6 +105,20 @@ fn get_documentation( long_desc.push_str("\n\n"); } + if !sig.search_terms.is_empty() { + let _ = write!( + long_desc, + "{help_section_name}Search terms{RESET}: {help_subcolor_one}{}{RESET}\n\n", + sig.search_terms.join(", "), + ); + } + + let _ = write!( + long_desc, + "{help_section_name}Usage{RESET}:\n > {}\n", + sig.call_signature() + ); + // TODO: improve the subcommand name resolution // issues: // - Aliases are included @@ -126,20 +140,6 @@ fn get_documentation( } } - if !sig.search_terms.is_empty() { - let _ = write!( - long_desc, - "{help_section_name}Search terms{RESET}: {help_subcolor_one}{}{RESET}\n\n", - sig.search_terms.join(", "), - ); - } - - let _ = write!( - long_desc, - "{help_section_name}Usage{RESET}:\n > {}\n", - sig.call_signature() - ); - if !subcommands.is_empty() { let _ = write!(long_desc, "\n{help_section_name}Subcommands{RESET}:\n"); subcommands.sort();