summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2022-03-12 20:20:34 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2022-03-12 20:20:34 +0100
commitbf9b0b538b163ef1f05391511d0c01516ad9f2a0 (patch)
tree1cb98ddd511d4c3100616fbb9b3f170c86f7c8d1
parent049f21cfe779dbcd795d04917dff4ec3034a1546 (diff)
More docstrings
-rw-r--r--hazwaz/command.py16
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: