Skip to content

Commit

Permalink
Fix: command: do_help does not as as a 3rd level subcommand
Browse files Browse the repository at this point in the history
should pass the name of all ancestor levels to `help_contextual`.
  • Loading branch information
nicholasyang2022 committed Sep 23, 2024
1 parent c4ce88e commit 1b1abcf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 3 additions & 5 deletions crmsh/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,9 @@ def do_quit(self, context):
@completer(_help_completer)
def do_help(self, context, *args):
"""usage: help topic|level|command"""
if context.level_name() == 'root':
levels = args
else:
levels = [context.level_name()]
levels.extend(args)
levels = [ui.name for ui in context.stack]
levels = levels[1:] # drop the 1st element "root"
levels.extend(args)
h = help_module.help_contextual(levels)
h.paginate()
context.command_name = ""
Expand Down
2 changes: 2 additions & 0 deletions test/features/bootstrap_options.feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Feature: crmsh bootstrap process - options
Then Expected "-x option or SKIP_CSYNC2_SYNC can't be used with any stage" in stderr
When Try "crm cluster init sbd -N hanode1 -N hanode2 -y" on "hanode1"
Then Expected "Can't use -N/--nodes option and stage(sbd) together" in stderr
When Try "crm corosync link help add" on "hanode1"
Then Expected return code is "0"

@clean
Scenario: Stage validation
Expand Down

0 comments on commit 1b1abcf

Please sign in to comment.