Updated help.py
- Changed class layout to use updated command registry.
- Class uses the decorator function with appropriate arugments.
This commit is contained in:
parent
c8abba3165
commit
11435da41b
|
|
@ -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 [<command1>, <command2>, ..., <commandn>]
|
||||
|
||||
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 [<command1>, <command2>, ..., <commandn>]",
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user