From c6ef4b6a6b0177ad86ad95b17a44eb1aa5ae0103 Mon Sep 17 00:00:00 2001 From: Nathan West Date: Thu, 10 Aug 2017 16:52:04 -0400 Subject: [PATCH] Updated the readme with the new docstring behavior --- README.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index a9ab447..91f2727 100644 --- a/README.rst +++ b/README.rst @@ -217,14 +217,16 @@ If the default value is a file object, such as ``sys.stdout``, then autocommand Descriptions and docstrings ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The ``autocommand`` decorator accepts ``description`` and ``epilog`` kwargs, corresponding to the `description `_ and `epilog `_ of the ``ArgumentParser``. If no description is given, but the decorated function has a docstring, then it is taken as the ``description`` for the ``ArgumentParser`` +The ``autocommand`` decorator accepts ``description`` and ``epilog`` kwargs, corresponding to the `description `_ and `epilog `_ of the ``ArgumentParser``. If no description is given, but the decorated function has a docstring, then it is taken as the ``description`` for the ``ArgumentParser``. You can also provide both the description and epilog in the docstring by splitting it into two sections with 4 or more - characters. .. code:: python - @autocommand(__name__, epilog='Some extra documentation in the epilog') + @autocommand(__name__) def copy(infile=sys.stdin, outfile=sys.stdout): ''' Copy an the contents of a file (or stdin) to another file (or stdout) + ---------- + Some extra documentation in the epilog ''' with smart_open(infile) as istr: with smart_open(outfile, 'w') as ostr: