From 11435da41be8399d40176bb0d6e797bee97ce54d Mon Sep 17 00:00:00 2001 From: TheOnePath Date: Wed, 2 Aug 2023 15:42:26 +0100 Subject: [PATCH] Updated help.py - Changed class layout to use updated command registry. - Class uses the decorator function with appropriate arugments. --- soypak/cli/commands/help.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/soypak/cli/commands/help.py b/soypak/cli/commands/help.py index 5147cf4..d1dd841 100644 --- a/soypak/cli/commands/help.py +++ b/soypak/cli/commands/help.py @@ -2,16 +2,12 @@ import argparse import soypak.cli.command as command -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. -""" - - name = "help" - +@command.register_command(name="help", help=command.CommandHelpStruct( + synopsis="Display the help message of the give command(s), or print this message.", + usage="Usage: help [, , ..., ]", + summary=("If no arguments are specified, the general help message is displayed.")) +) +class Help(command.Command): def __init__(self, *, data: argparse.Namespace, args: list[str] = []) -> None: super().__init__() self.data = data