summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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):