Skip to content

Commit

Permalink
Dev: ui_context: ignore requirements when option --help is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasyang2022 committed Apr 25, 2024
1 parent 11e262d commit f4ec6b0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion crmsh/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,5 +512,6 @@
RSC_ROLE_UNPROMOTED_LEGACY = "Slave"
PCMK_VERSION_DEFAULT = "2.0.0"

NON_FUNCTIONAL_COMMANDS = ('help', 'cd', 'ls', 'quit', 'up')
NON_FUNCTIONAL_COMMANDS = {'help', 'cd', 'ls', 'quit', 'up'}
NON_FUNCTIONAL_OPTIONS = {'--help', '--help-without-redirect'}
# vim:ts=4:sw=4:et:
3 changes: 2 additions & 1 deletion crmsh/ui_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def run(self, line):
cmd = True
break
if cmd:
if self.command_name not in constants.NON_FUNCTIONAL_COMMANDS:
if self.command_name not in constants.NON_FUNCTIONAL_COMMANDS\
and all(arg not in constants.NON_FUNCTIONAL_OPTIONS for arg in self.command_args):
entry = self.current_level()
if 'requires' in dir(entry) and not entry.requires():
self.fatal_error("Missing requirements")
Expand Down
2 changes: 0 additions & 2 deletions doc/toolchain/bin/adocxt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ RE_SECTION_TITLE = re.compile('^=')
RE_FROM_CODE_OR_SECTION_TITLE=re.compile(r'^(?:\[\[([^,]+),[^,]*,From Code]]$|=)')

TAG_EXCLUDES = {
'cmdhelp_node_online',
'cmdhelp_node_standby',
'cmdhelp_root_report',
}

Expand Down

0 comments on commit f4ec6b0

Please sign in to comment.