From 087e5431491881436f98d9cf67393fe8baa1b73c Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Tue, 22 Feb 2022 20:00:07 +0100 Subject: Added some docstrings --- hazwaz/command.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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): -- cgit v1.2.3