From 1a2095e5c373430e5aa4bda2ee24f65f4527a002 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Wed, 9 Sep 2020 01:26:08 -0400 Subject: Added section to completion docs about read_input() function --- docs/features/completion.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'docs') diff --git a/docs/features/completion.rst b/docs/features/completion.rst index 0e6bedd9..3894a4eb 100644 --- a/docs/features/completion.rst +++ b/docs/features/completion.rst @@ -89,6 +89,7 @@ completion hints. .. _argparse-based: + Tab Completion Using argparse Decorators ---------------------------------------- @@ -132,6 +133,17 @@ any of the 3 completion parameters: ``choices``, ``choices_provider``, and See the argparse_completion_ example or the implementation of the built-in :meth:`~cmd2.Cmd.do_set` command for demonstration of how this is used. + +Custom Completion with ``read_input()`` +-------------------------------------------------- + +``cmd2`` provides :attr:`cmd2.Cmd.read_input` as an alternative to Python's +``input()`` function. ``read_input`` supports configurable tab completion and +up-arrow history at the prompt. See read_input_ example for a demonstration. + +.. _read_input: https://github.com/python-cmd2/cmd2/blob/master/examples/read_input.py + + For More Information -------------------- -- cgit v1.2.1