Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions crmsh/ui_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
logger = log.setup_logger(__name__)
logger_utils = log.LoggerUtils(logger)

_NON_FUNCTIONAL_COMMANDS = {'help', 'cd', 'ls', 'quit', 'up'}
_NON_FUNCTIONAL_COMMANDS = {'help', 'ls'}
_NON_FUNCTIONAL_OPTIONS = {'--help', '--help-without-redirect'}

class Context(object):
Expand Down Expand Up @@ -257,8 +257,10 @@ def enter_level(self, level):
self._in_transit = True

entry = level()
if 'requires' in dir(entry) and not entry.requires():
self.fatal_error("Missing requirements")
if self.command_name not in _NON_FUNCTIONAL_COMMANDS \
and all(arg not in _NON_FUNCTIONAL_OPTIONS for arg in self.command_args):
if 'requires' in dir(entry) and not entry.requires():
self.fatal_error("Missing requirements")
self.stack.append(entry)
self.clear_readline_cache()

Expand Down