Skip to content

Commit

Permalink
Merge branch 'hotfix-1.0.1' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucretiel committed Mar 11, 2015
2 parents 56b0bc6 + 99a035f commit 0e2c761
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ Even though autocommand is being applied to the ``wrapper`` returned by ``print_
Testing and Library use
-----------------------

The decorated function is only called and exited from if the first argument to ``autocommand`` is ``'__main__'`` or ``True``. If it is neither of these values, or no argument is given, then a new main function is created by the decorator. This function has the signature ``main(*argv)``, and is intended to be called with arguments as if via ``main(*sys.argv)``. Note that this includes the program name, ``argv[0]``. The function has the attributes ``parser`` and ``main``, which are the generated ``ArgumentParser`` and the original main function that was decorated. This is to facilitate testing and library use of your main. Calling the function triggers a ``parse_args()`` with the supplied arguments, and returns the result of the main function. Note that, while it returns instead of calling ``sys.exit``, the ``parse_args()`` function will raise a ``SystemExit`` in the event of a parsing error or ``-h/--help`` argument.
The decorated function is only called and exited from if the first argument to ``autocommand`` is ``'__main__'`` or ``True``. If it is neither of these values, or no argument is given, then a new main function is created by the decorator. This function has the signature ``main(*argv)``, and is intended to be called with arguments as if via ``main(*sys.argv[1:])``. The function has the attributes ``parser`` and ``main``, which are the generated ``ArgumentParser`` and the original main function that was decorated. This is to facilitate testing and library use of your main. Calling the function triggers a ``parse_args()`` with the supplied arguments, and returns the result of the main function. Note that, while it returns instead of calling ``sys.exit``, the ``parse_args()`` function will raise a ``SystemExit`` in the event of a parsing error or ``-h/--help`` argument.

.. code:: python
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def getfile(filename):

setup(
name='autocommand',
version='1.0.0',
version='1.0.1',
py_modules=['autocommand'],
package_dir={'': 'src'},
platforms='any',
Expand Down
2 changes: 1 addition & 1 deletion src/autocommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from io import IOBase


__version__ = '1.0.0'
__version__ = '1.0.1'


_empty = Parameter.empty
Expand Down

0 comments on commit 0e2c761

Please sign in to comment.