diff --git a/crmsh/command.py b/crmsh/command.py index 77ff717fa..3ac52adf7 100644 --- a/crmsh/command.py +++ b/crmsh/command.py @@ -415,10 +415,18 @@ def do_quit(self, context): .... ''') @completer(_help_completer) - def do_help(self, context, subject=None, subtopic=None): + def do_help(self, context, *args): """usage: help topic|level|command""" - h = help_module.help_contextual(context.level_name(), subject, subtopic) - h.paginate() + subject, subtopic = None, None + other_args = [] + if args: + subject = args[0] + if len(args) >= 2: + subtopic = args[1] + other_args = args[2:] + h = help_module.help_contextual(context.level_name(), subject, subtopic, other_args) + if h: + h.paginate() context.command_name = "" def get_completions(self): diff --git a/crmsh/help.py b/crmsh/help.py index 5ac08fd7d..1817dcc5c 100644 --- a/crmsh/help.py +++ b/crmsh/help.py @@ -32,6 +32,7 @@ from . import config from . import clidisplay from .ordereddict import odict +from . import ra from . import log @@ -261,11 +262,25 @@ def _is_level(level): return fuzzy_get(_LEVELS, level) -def help_contextual(context, subject, subtopic): +def _is_property(level, command, args): + return level == 'configure' and command == 'property' and len(args) == 1 + + +def help_contextual(context, subject, subtopic, args): """ Returns contextual help """ _load_help() + if _is_property(subject, subtopic, args): + property_name = args[0] + agent = ra.get_properties_meta() + if agent: + all_properties = agent.params() + if property_name in all_properties: + print(agent.meta_parameter(property_name)) + else: + raise ValueError(f"Unknown property '{property_name}'") + return None if subject is None: if context == 'root': return help_overview() diff --git a/crmsh/ui_configure.py b/crmsh/ui_configure.py index a2e7ce598..7bc2c2a12 100644 --- a/crmsh/ui_configure.py +++ b/crmsh/ui_configure.py @@ -1125,6 +1125,9 @@ def do_rsc_ticket(self, context, *args): def do_property(self, context, *args): "usage: property [$id=]