summaryrefslogtreecommitdiff
path: root/tests/test_completion.py
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge branch 'master' into quoted_completionTodd Leonhardt2018-03-181-2/+2
|\ \ | |/
| * Fixed indexes in unit testsKevin Van Brunt2018-03-181-3/+3
| |
* | Backing up workKevin Van Brunt2018-03-181-9/+18
| |
* | First version of allowing quotes in tab completionKevin Van Brunt2018-03-171-8/+8
|/
* Changing how commands are parsed if default_to_shell is TrueKevin Van Brunt2018-03-161-3/+6
|
* Skip test_default_to_shell_completion unit test on WindowsTodd Leonhardt2018-03-161-6/+3
| | | | | | | | Python's built-in cmd module (and cmd2 which inherits from it) parses the command line and has relatively strict rules when parsing the beginning of the line looking for a "command". This command can must consist of ASCII letters and digits. The parsing logic applies prior to the default_to_shell flag attempting to run this "command" as a shell command. A problem occurs on Windows in that nearly all executables have a "." in their name. cmd/cmd2 will view everything before the "." as being the command. On Windows, I would strongly encourage the use of "!" or "shell" to run shell commands and would recommend against using the "default_to_shell" flag unless you are working within the Windows Subsystem for Linux (WSL).
* Added unit test for completing when default_to_shell is TrueKevin Van Brunt2018-03-161-0/+39
|
* Added unit tests for alias, unalias, and basic_completeKevin Van Brunt2018-03-161-2/+37
|
* More unit test fixesKevin Van Brunt2018-03-161-3/+9
|
* No longer need to manually specify subcommand names for tab completionKevin Van Brunt2018-03-141-4/+1
|
* missing args in calling completenamesAlberto Sartori2018-03-121-21/+265
|
* Added a few unit testsTodd Leonhardt2018-03-031-0/+28
|
* Removed support for case-insensitive command parsingTodd Leonhardt2018-03-021-11/+2
|
* Fixed slicing bugKevin Van Brunt2018-03-021-1/+1
|
* Fixed some parsing bugs and added more unit testsKevin Van Brunt2018-03-021-6/+59
|
* Added tab completion exampleKevin Van Brunt2018-03-021-7/+7
|
* Added unit tests for index based completionKevin Van Brunt2018-03-021-4/+48
|
* Added unit tests for flag based completionKevin Van Brunt2018-03-021-9/+61
|
* Sorting all completion results. Added unit tests for help command.Kevin Van Brunt2018-03-021-5/+35
|
* Fixed unit tests that call completeKevin Van Brunt2018-03-021-10/+135
|
* Corrected tab completion of subcommands.Kevin Van Brunt2018-03-021-46/+0
|
* Fixed typoKevin Van Brunt2018-03-011-1/+1
|
* Fixed more unit testsKevin Van Brunt2018-03-011-19/+16
|
* Fixed unit testsKevin Van Brunt2018-03-011-10/+11
|
* Removed an assertion which will fail if your home directory is emptykotfu2018-02-201-5/+0
| | | | NixOS build and packaging system builds with a fake $HOME which has no contents. This assertion will fail in those cases, and doesn’t really test the completion code anyway.
* help command temporarily redirects sys.stdout and sys.stderr to self.stdout ↵Todd Leonhardt2018-01-221-3/+3
| | | | | | | | for argparse commands In order to make "help" behave more consistently for decorated and undecorated commands, argparse output is temporarily redirected to self.stdout. So doing "help history" is similar to "help load". However, when using the "-h" with argparse commands without using the "help" command, the output from argparse isn't redirected to self.stdout. Fixing this would be rather difficult and would essentially involve creating a pyparsing rule to detect it at the parser level.
* Renamed @with_argument_parser decorator to @with_argparserTodd Leonhardt2018-01-211-5/+5
| | | | | Also: - Reanamed foo and bar subcommand methods to base_foo and base_bar
* Added unit tests for newly-overridden complete() methodTodd Leonhardt2018-01-201-0/+120
| | | | Also added a section on Sub-commands to the documentation.
* Added unit tests for sub-commandsTodd Leonhardt2018-01-201-0/+97
|
* Added support for case-insensitive tab-completion of cmd2 command namesTodd Leonhardt2017-07-131-0/+22
|
* Avoid conflict the `eg` tool from go-toolsFelix Yan2017-07-101-1/+1
| | | | | With go-tools installed there is an `eg` command in system search path. Let's add an additional character to avoid the test failure.
* Fix a bug in a unit test which can happen in atypical circumstancesTodd Leonhardt2017-07-051-1/+1
|
* Don't run an assert on Windows since it is failing on AppVeyorTodd Leonhardt2017-07-011-2/+6
| | | | It passes on my Windows 10 VM, but fails on AppVeyor. But manual testing reveals the feature is working.
* Attempt at fixing failing Windows unit testTodd Leonhardt2017-07-011-2/+8
| | | | Windows doesn't have an "ls" command by default ...
* Added some more tests for path completion and shell command completionTodd Leonhardt2017-07-011-30/+130
| | | | | | | Also: - Added a test for do_pause - Cleaned up a bunch of magic numbers from existing test for shell and path command completion
* Multiple changesTodd Leonhardt2017-06-281-1/+1
| | | | | | | | - Disabled TravisCI macOS builds because they are heavily backlogged - Removed a file which should never have been committed - Updated Sphinx docs to relect that the default_file_name settable parameter no longer exists - Fixed comment in a unit test - Fixed a unit test to use os.path.sep for cross-platform compatibility
* Completely removed use of self.default_file_nameTodd Leonhardt2017-06-281-1/+1
| | | | | | | | Load and relative load now require a file path Edit will use a temporary file by default and delete it when done Save will use a temporary file by default and inform the user what it is Also changed the default value for autorun_on_edit to False so that it can safely be used as an actual file editor.
* Added pyscript unit test and attempt to fix a path completion test on WindowsTodd Leonhardt2017-06-241-1/+29
|
* Added some path completion unit testsTodd Leonhardt2017-06-241-1/+69
| | | | Also added some command completion unit tests for cases where there are no matches
* Trying to fix shell command completion unit tests on Windows.Todd Leonhardt2017-06-151-10/+10
| | | | pyreadline won't engage the completer when just "!calc" is typed, need "! calc" or "shell calc". Basically it needs a space after to recognize it as a command and route it to the correct completer method.
* Added some tests for command completion, help completion, and shell command ↵Todd Leonhardt2017-06-151-0/+97
completion TODO: Still need to add a bunch of tests for path competion and more tests for all of the above mentioned completion cases.