diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-10-06 19:27:08 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-10-06 19:27:08 -0400 |
commit | d0654e136ae19837d8659b064205115ce59f940f (patch) | |
tree | a8b32b6c0d7d0bb07e8bf156c5fdccbc25004571 /docs/argument_processing.rst | |
parent | e018924a28443e8e6f608d9b9796b2b826653490 (diff) | |
download | cmd2-git-d0654e136ae19837d8659b064205115ce59f940f.tar.gz |
Added warning to documentation about how help_foo won't be called for command foo if it uses an argparse decorator
Also:
- Renamed argparse_example.py to decorator_example.py
Diffstat (limited to 'docs/argument_processing.rst')
-rw-r--r-- | docs/argument_processing.rst | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/docs/argument_processing.rst b/docs/argument_processing.rst index 9d13a7c8..8931c60b 100644 --- a/docs/argument_processing.rst +++ b/docs/argument_processing.rst @@ -15,11 +15,11 @@ Argument Processing These features are all provided by the ``@with_argparser`` decorator which is importable from ``cmd2``. -See the either the argprint_ or argparse_ example to learn more about how to use the various ``cmd2`` argument +See the either the argprint_ or decorator_ example to learn more about how to use the various ``cmd2`` argument processing decorators in your ``cmd2`` applications. .. _argprint: https://github.com/python-cmd2/cmd2/blob/master/examples/arg_print.py -.. _argparse: https://github.com/python-cmd2/cmd2/blob/master/examples/argparse_example.py +.. _decorator: https://github.com/python-cmd2/cmd2/blob/master/examples/decorator_example.py Using the argument parser decorator =================================== @@ -171,6 +171,14 @@ Which yields: This command can not generate tags with no content, like <br/> +.. warning:: + + If a command **foo** is decorated with one of cmd2's argparse decorators, then **help_foo** will not + be invoked when ``help foo`` is called. The argparse_ module provides a rich API which can be used to + tweak every aspect of the displayed help and we encourage ``cmd2`` developers to utilize that. + +.. _argparse: https://docs.python.org/3/library/argparse.html + Grouping Commands ================= |