diff --git a/soypak/cli/commands/help.py b/soypak/cli/commands/help.py index 792e4f0..5147cf4 100644 --- a/soypak/cli/commands/help.py +++ b/soypak/cli/commands/help.py @@ -6,9 +6,11 @@ class Help(command.Command, metaclass=command.RegisterCommand): __doc__ = """Display the help message of the give command(s), or print this message. Usage: help [, , ..., ] + +If no arguments are specified, the general help message is displayed. """ - __cmd_name__ = "help" + name = "help" def __init__(self, *, data: argparse.Namespace, args: list[str] = []) -> None: super().__init__() @@ -17,8 +19,13 @@ Usage: help [, , ..., ] def run(self): - print("running command: %s" % __name__) - print(self.data, self.rargs) - if not self.rargs: self.parser.print_help() + + for arg in self.rargs: + obj = self.get_command(arg, error=True) + if obj is None: + pass + + print("%s: %s" % (obj.__class__.name, obj.__doc__)) +