diff options
| author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-03-16 19:36:22 -0400 |
|---|---|---|
| committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-03-16 19:36:22 -0400 |
| commit | 305ed55baeeec94610c9d6662bf6f71a928c8932 (patch) | |
| tree | 60d47ae1bd6ec0678db4ac15280b321c7943f415 /docs | |
| parent | 9a1d22de8b65c143252a2dbe389616a212e57ce4 (diff) | |
| download | cmd2-git-305ed55baeeec94610c9d6662bf6f71a928c8932.tar.gz | |
Documented cmd_with_subs_completer function
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/argument_processing.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/argument_processing.rst b/docs/argument_processing.rst index 957c842a..15c947fb 100644 --- a/docs/argument_processing.rst +++ b/docs/argument_processing.rst @@ -214,7 +214,13 @@ Sub-commands Sub-commands are supported for commands using either the ``@with_argparser`` or ``@with_argparser_and_unknown_args`` decorator. The syntax for supporting them is based on argparse sub-parsers. +Also, a convenience function called ``cmd_with_subs_completer`` is available to easily add tab completion to functions +that implement subcommands. By setting this as the completer of the base command function, the correct completer for +the chosen subcommand will be called. + See the subcommands_ example to learn more about how to use sub-commands in your ``cmd2`` application. +This example also demonstrates usage of ``cmd_with_subs_completer``. In addition, the docstring for +``cmd_with_subs_completer`` offers more details. .. _subcommands: https://github.com/python-cmd2/cmd2/blob/master/examples/subcommands.py |
