mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 14:48:44 +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:
@ -139,14 +139,10 @@ impl<'a> PluginExecutionContext for PluginExecutionCommandContext<'a> {
|
||||
fn get_help(&self) -> Result<Spanned<String>, ShellError> {
|
||||
let decl = self.engine_state.get_decl(self.call.decl_id);
|
||||
|
||||
Ok(get_full_help(
|
||||
&decl.signature(),
|
||||
&decl.examples(),
|
||||
&self.engine_state,
|
||||
&mut self.stack.clone(),
|
||||
false,
|
||||
Ok(
|
||||
get_full_help(decl, &self.engine_state, &mut self.stack.clone())
|
||||
.into_spanned(self.call.head),
|
||||
)
|
||||
.into_spanned(self.call.head))
|
||||
}
|
||||
|
||||
fn get_span_contents(&self, span: Span) -> Result<Spanned<Vec<u8>>, ShellError> {
|
||||
|
Reference in New Issue
Block a user