aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2022-02-22 20:00:07 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2022-02-22 20:00:07 +0100
commit087e5431491881436f98d9cf67393fe8baa1b73c (patch)
tree76ce08f51e16132e70d50f60a529176afd2718c9
parenta329d55291fab275a1713fb1b409eb59dda3c3d4 (diff)
Added some docstrings
-rw-r--r--hazwaz/command.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/hazwaz/command.py b/hazwaz/command.py
index a8866ab..6618946 100644
--- a/hazwaz/command.py
+++ b/hazwaz/command.py
@@ -19,6 +19,20 @@ def _get_remaining_docstring_lines(obj):
class MainCommand:
+ '''
+ The main class for a command line command.
+
+ Your script will have to subclass this once, instantiate and run its
+ :py:meth:`main()` e.g. as::
+
+ class MyCommand(MainCommand):
+ """
+ A description that will be used in the help.
+ """
+
+ if __name__ == "__main__":
+ MyCommand().main()
+ '''
commands = ()
def __init__(self):
@@ -72,6 +86,12 @@ class MainCommand:
class Command:
+ """
+ A subcommand to a MainCommand.
+
+ Every subcommand of your script will be a subclass of this, added to
+ the :py:attribute:`subcommands` of the MainCommand.
+ """
name = None
def __init__(self):