diff options
-rw-r--r-- | hazwaz/command.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/hazwaz/command.py b/hazwaz/command.py index 2bfa2b9..28c3fa5 100644 --- a/hazwaz/command.py +++ b/hazwaz/command.py @@ -33,7 +33,11 @@ class MainCommand: if __name__ == "__main__": MyCommand().run() ''' + commands = () + """ + The subcommands: a tuple of :py:class:`Command` subclasses. + """ def __init__(self): desc = _get_first_docstring_line(self) @@ -86,6 +90,11 @@ class MainCommand: ) def run(self): + """ + Run the command. + + This is the method called to start running the command. + """ self.args = self.parser.parse_args() if getattr(self.args, "debug", False): @@ -105,7 +114,14 @@ class Command: Every subcommand of your script will be a subclass of this, added to the :py:attr:`MainCommand.subcommands`. """ + name = None + """ + The name used to call this subcommand from the command line. + + If this property is none, the default is the name of the class set + to lowercase. + """ def __init__(self): if self.name is None: |