Updated help.py

- Changed class layout to use updated command registry.
    - Class uses the decorator function with appropriate arugments.
This commit is contained in:
Ethan Smith-Coss 2023-08-02 15:42:26 +01:00
parent c8abba3165
commit 11435da41b
Signed by: TheOnePath
GPG Key ID: 4E7D436CE1A0BAF1

View File

@ -2,16 +2,12 @@ import argparse
import soypak.cli.command as command import soypak.cli.command as command
class Help(command.Command, metaclass=command.RegisterCommand): @command.register_command(name="help", help=command.CommandHelpStruct(
__doc__ = """Display the help message of the give command(s), or print this message. synopsis="Display the help message of the give command(s), or print this message.",
usage="Usage: help [<command1>, <command2>, ..., <commandn>]",
Usage: help [<command1>, <command2>, ..., <commandn>] summary=("If no arguments are specified, the general help message is displayed."))
)
If no arguments are specified, the general help message is displayed. class Help(command.Command):
"""
name = "help"
def __init__(self, *, data: argparse.Namespace, args: list[str] = []) -> None: def __init__(self, *, data: argparse.Namespace, args: list[str] = []) -> None:
super().__init__() super().__init__()
self.data = data self.data = data