Skip to content

Commit 8520938

Browse files
authored
Merge pull request #329 from python-cmd2/new_quoted_completion
Adding tab completion improvements
2 parents 28c89a5 + cd0674f commit 8520938

File tree

14 files changed

+1652
-1208
lines changed

14 files changed

+1652
-1208
lines changed

CHANGELOG.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
## 0.8.3 (TBD)
2+
* Bug Fixes
3+
* Fixed ``help`` command not calling functions for help topics
4+
* Fixed not being able to use quoted paths when redirecting with ``<`` and ``>``
5+
6+
* Enhancements
7+
* Tab completion has been overhauled and now supports completion of strings with quotes and spaces.
8+
* Tab completion will automatically add an opening quote if a string with a space is completed.
9+
* Added ``delimiter_complete`` function for tab completing delimited strings
10+
* Added more control over tab completion behavior including the following flags. The use of these flags is documented in cmd2.py
11+
* ``allow_appended_space``
12+
* ``allow_closing_quote``
13+
14+
* Attribute Changes (Breaks backward compatibility)
15+
* ``exclude_from_help`` is now called ``hidden_commands`` since these commands are hidden from things other than help, including tab completion
16+
* This list also no longer takes the function names of commands (``do_history``), but instead uses the command names themselves (``history``)
17+
* ``excludeFromHistory`` is now called ``exclude_from_history``
18+
* ``cmd_with_subs_completer()`` no longer takes an argument called ``base``. Adding tab completion to subcommands has been simplified to declaring it in the
19+
subcommand parser's default settings. This easily allows arbitrary completers like path_complete to be used.
20+
See [subcommands.py](https://github.com/python-cmd2/cmd2/blob/master/examples/subcommands.py) for an example of how to use
21+
tab completion in subcommands. In addition, the docstring for ``cmd_with_subs_completer()`` offers more details.
22+
23+
124
## 0.8.2 (March 21, 2018)
225

326
* Bug Fixes
@@ -14,7 +37,7 @@
1437
* See [alias_startup.py](https://github.com/python-cmd2/cmd2/blob/master/examples/alias_startup.py) for an example
1538
* Added a default SIGINT handler which terminates any open pipe subprocesses and re-raises a KeyboardInterrupt
1639
* For macOS, will load the ``gnureadline`` module if available and ``readline`` if not
17-
40+
1841
## 0.8.1 (March 9, 2018)
1942

2043
* Bug Fixes
@@ -56,7 +79,7 @@
5679
* See the [Argument Processing](http://cmd2.readthedocs.io/en/latest/argument_processing.html) section of the documentation for more information on these decorators
5780
* Alternatively, see the [argparse_example.py](https://github.com/python-cmd2/cmd2/blob/master/examples/argparse_example.py)
5881
and [arg_print.py](https://github.com/python-cmd2/cmd2/blob/master/examples/arg_print.py) examples
59-
* Added support for Argpasre sub-commands when using the **with_argument_parser** or **with_argparser_and_unknown_args** decorators
82+
* Added support for Argparse sub-commands when using the **with_argument_parser** or **with_argparser_and_unknown_args** decorators
6083
* See [subcommands.py](https://github.com/python-cmd2/cmd2/blob/master/examples/subcommands.py) for an example of how to use subcommands
6184
* Tab-completion of sub-command names is automatically supported
6285
* The **__relative_load** command is now hidden from the help menu by default

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ Instructions for implementing each feature follow.
8282

8383
- Searchable command history
8484

85-
All commands will automatically be tracked in the session's history, unless the command is listed in Cmd's excludeFromHistory attribute.
85+
All commands will automatically be tracked in the session's history, unless the command is listed in Cmd's exclude_from_history attribute.
8686
The history is accessed through the `history` command.
8787
If you wish to exclude some of your custom commands from the history, append their names
88-
to the list at `Cmd.ExcludeFromHistory`.
88+
to the list at `Cmd.exclude_from_history`.
8989

9090
- Load commands from file, save to file, edit commands in file
9191

0 commit comments

Comments
 (0)