diff --git a/suzieq/cli/sqcmds/command.py b/suzieq/cli/sqcmds/command.py index 7fafe86960..c7b0c0e2cb 100644 --- a/suzieq/cli/sqcmds/command.py +++ b/suzieq/cli/sqcmds/command.py @@ -250,13 +250,16 @@ def help(self, command: str = ''): Style.RESET_ALL) print("\nSupported verbs are: ") for verb in verbs: - if verbs[verb].__doc__: - docstr = verbs[verb].__doc__.splitlines()[0] + docstr = inspect.getdoc(verbs[verb]) + if docstr: + docstr = docstr.splitlines()[0] else: docstr = '' verb = verb.replace('aver', 'assert') print(f" - {verb}: " + Fore.CYAN + f"{docstr}" + Style.RESET_ALL) + print(f"\nUse " + Fore.CYAN + f"{self.sqobj.table} help command=" + + Style.RESET_ALL + " for more details on that verb") else: self._do_help(self.sqobj.table, command) @@ -287,9 +290,9 @@ def _do_help(self, table: str, verb: str = 'show'): fnargs = elem[1] break - docstr = [x[1] for x in fnmbrs if x[0] == '__doc__'] + docstr = inspect.getdoc(fnlist[newverb]) if docstr: - docstr = docstr[0].splitlines()[0] + docstr = docstr.splitlines()[0] else: docstr = '' print(f"{table} {verb}: " + Fore.CYAN +