| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Also removed default argument for _relative_load and load
|
|
|
|
| |
From what I can tell, this hasn't worked in years and there aren't any unit tests which display how it is supposed to work.
|
| |
|
| |
|
|
|
|
|
|
| |
- Removed some dead code in cmd2.py which was never used
- Added a number of unit tests
- Fixed how get_paste_buffer() and write_paste_buffer() work on macOS so that they work correctly on both Python 2.7 and Python 3.3+
|
| |
|
|
|
|
| |
This is an attempt at making the cmdenvironment output more informative and easier to understand.
|
|
|
|
|
|
|
|
|
|
|
|
| |
I originally created separate help_* methods for various built-in do_* methods so that:
- The Sphinx docs could use the do_* docstring which could have extra reStructuredText markup embedded
- The built-in help command could use the text from the help_* method
This seemed like a good idea at the time, but I changed my mind - I was actually adding a maintenance headache.
- And the payoff was small
So I have now switched to using the do_* docstring for both the built-in help and Sphinx documentation.
- With some very minor usage of reStructuredText markup that doesn't look bad when displaying built-in help
|
|
|
|
| |
We now more closely emulate how Bash does or does not append a space.
|
|
|
|
| |
Added override for convenience of automatically adding a space when tab-completing a command name.
|
|
|
|
| |
Bumped version in preparation for 0.7.3 release probably within the next couple weeks.
|
|
|
|
|
|
|
|
|
|
|
| |
Now by default all @options commands get passed a list of argument strings instead of a single argument string.
This is a much easier and more robust behavior to deal with. Additionally, command-line arguments are intelligently separated based on location of quotes to group things into a single argument.
WARNING: This change breaks backward compatibility for older applicaitons based on cmd2. To change the behavior to the way it used to be, add the following code to the __init__() method of our class derived from cmd2.Cmd:
cmd2.set_use_arg_list(False)
This change really does make it easier for developers new to using cmd2 however. It is to the point where I create all custom commands with @options, even if I use an empty list for the options because the argument parsing is just much better this way.
|
| |
|
|
|
|
|
|
|
|
| |
This command is explicitly for running Python script files within an embedded Python interpreter.
The advantages over the py command with "run" are:
- Tab-completion of file system paths is supported
- Command-line arguments can be passed to the Python script
|
| |
|
|
|
|
| |
The finally block ensures that the self._in_py state variable always gets reset to "False" before exiting the function, even if an exception occurs.
|
| |
|
|
|
|
| |
This is because file paths which had a "-" in them were not being completed with tab completion of local paths.
|
|
|
|
|
|
| |
This is a bug that was introduced recently when the functionality of the list command was merged with the history command.
This prevents an unhandled exception crash under certain unlikely but possible circumstances.
|
|
|
|
|
|
|
|
| |
It no longer displays settable parameters since this functionality was redundant since those are displayed with either set or show.
It now shows additional global settings for parsing @options commands.
In the future a few more things should probably be displayed here related to parameters which are not settable at runtime.
|
|
|
|
|
|
|
|
| |
The extra functionality of listing a span (slice) of history items present in the list command has been incorporated into the existing history command and the list command has been removed.
Unit tests have been updated accordingly.
In the process a bug was fixed that was causing a crash if and end was supplied to the span but not a start.
|
| |
|
|
|
|
|
|
|
|
| |
Added a list of commands to explicitly exclude displaying in the help menu of commands which detailed help can be retrieved for.
By default, only "do_eof" is in this list since that isn't a command which is ever intended for an end user to directly enter on the command line.
Also updated unit tests to reflect new default help menu.
|
|
|
|
| |
Made changes to suppress PyCharm Code Introspection warnings
|
| |
|
| |
|
|
|
|
| |
Added a NOTE regarding what purpose it servers to the docstring
|
|\ |
|
| |
| |
| |
| | |
Fixed the path part of command completion of shell commands when that path happens to being with "~" (i.e. relies on user path expansion).
|
| |
| |
| |
| | |
Changing to alpha version just to avoid confusion with release in PyPI
|
|/ |
|
| |
|
|
|
|
|
|
| |
call protected
Added a leading underscore to several methods and attributes. This is for things which I don't think an end user should ever need to call.
|
| |
|
|
|
|
|
|
| |
Due to the way the parsing logic works for multiline commands, abbreviations didn't function properly with mutliline commands. So to avoid confusion, this commit deals with this issue by simply disallowing abbreviations for multiline commands altogether.
A warning has been added to the section on abbreviations in the documentation to hopefully make this clear for users.
|
|
|
|
|
|
| |
Fixed a bug where a path separator was hard-coded as ":" and replaced it with os.path.pathsep
Also changed version from 0.7.1a to 0.7.1 in preparation for upcoming release.
|
|
|
|
| |
command completion
|
| |
|
|
|
|
|
|
|
|
| |
Attempting to emulate Bash shell behavior as closely as possible.
Path completion is significantly improved.
Shell command completion of commands is also supported now.
|
|
|
|
| |
If local path completion has a single result which is a directory, then a trailing path separator is appended for convenience.
|
|
|
|
|
|
| |
The edit, load, and shell commands now all use this for their tab completion.
Additionally, end users can easily wire it up for use with any of their custom commands.
|
| |
|
| |
|
|
|
|
|
|
| |
GNU Readline has a bug in calculating prompt length when ANSI escape codes are present in the prompt. It requires you to escape the escape codes to tell it where sections of invisible characters begin and end.
So before calling input(), cmd2 now makes the prompt safe by escaping any ANSI escape codes present.
|
|
|
|
| |
The current version of gnureadline available in pip and conda has a malloc error, at least on Mac OS
|
|
|
|
| |
NOTE: For real use on Windows you should have pyreadline installed.
|
| |
|
|
|
|
|
|
| |
Transcript testing no longer creates an unnecessary 2nd instance of the class derived from cmd2.Cmd. This dramatically simplifies transcript testing for derived classes which have required parameters during construction.
As a side effect the, feedback_to_output attribute now defaults to false. This had some minor ripple effects on various unit tests.
|
| |
|
|
|
|
| |
If a non-zero return code is returned from the shell command, just ignore it.
|