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
|
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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user