| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
It was pretty useless, it just printed a message and sat there and waited for the user to hit enter.
It didn't feel like it belonged in a top-level framework. If a particular application wants this functionality, it is a 2 line change to add it back.
|
| |
|
|
|
|
|
|
|
|
|
| |
Fixed a bug where CmdResult named tuple Truthiness wasn't working in Python 2
Removed unused cmd2.History.search() method.
Added unit tests for:
- History class
- cast() function
- CmdResult namedtuple
|
| |
|
|
| |
Also improved error handling in some exceptional cases.
|
| |
|
|
|
|
|
|
|
| |
The main advantages of this are that shell command output can now be
- piped to another shell command
- redirected to a file
In the future, I may take it a step further where the output is piped, but using a pipe versus a real terminal changes the behavior of many shell commands, for example by getting rid of ANSI color and various other pretty formatting.
|
| | |
|
| | |
|
| |
|
|
| |
It passes on my Windows 10 VM, but fails on AppVeyor. But manual testing reveals the feature is working.
|
| |
|
|
| |
Windows doesn't have an "ls" command by default ...
|
| |
|
|
|
|
|
| |
Also:
- Added a test for do_pause
- Cleaned up a bunch of magic numbers from existing test for shell and path command completion
|
| |
|
|
|
|
|
| |
Also
- Moved the existing tests for select to a more appropriate location
- Minor tweak to working in README for readability
|
| |
|
|
|
|
|
| |
Also:
- When running cmd2.py as main, enable use of IPython if present to aid with debugging and troubleshooting
- Deleted a unit test which wasn't reliable
|
| |
|
|
| |
Also skip unit test which passes when I run it on my systems, but fails on TravisCI and AppVeyor
|
| | |
|
| |
|
|
|
| |
- Added a couple unit tests related to cmd2.Cmd.default_to_shell
- Added a unit test related to cmd2.Cmd._surround_ansi_escapes()
|
| |
|
|
| |
Also added a few unit tests related to running an empty statement and dealing with precmd hook success and failure.
|
| |
|
|
|
|
|
| |
If Pyperclip could not find a copy/paste mechanism for your system, then
cmd2.can_clip gets set to False.
If cmd2.can_clip is False, then the "send_to_paste_buffer" test gets skipped.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
The previous fix was apparently broken when I checked in with Linux line endings. This approach should be independent of that.
|
| | |
|
| |
|
|
|
|
| |
The ability to pipe the output of a cmd2 command to a shell command no longer depends on the presence of the "cat" shell command.
It now directly pipes the contents of a file as the stdin to the shell command.
|
| |
|
|
| |
The self.settable object is now an OrderedDict instead of a custom StubbornDict.
|
| |
|
|
|
|
| |
utiliites for pastebuffer/clipboard interaction
Also removed a unit test which was now redundant since a newer one covered the same material in a better fashion.
|
| |
|
|
|
|
| |
It now uses cmd2.get_paste_buffer() to read the pastebuffer/clipboard instead of using Tkinter.
It now also tests appending to the pastebuffer/clipboard in addition to writing to it.
|
| |
|
|
|
|
|
|
| |
- 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
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
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.
|
| |
|
|
| |
clipboard/pastebuffer are not available
|
| | |
|
| |
|
|
| |
available
|
| |
|
|
|
|
| |
- 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+
|
| | |
|
| |
|
|
| |
Also added some command completion unit tests for cases where there are no matches
|
| | |
|
| | |
|
| |
|
|
| |
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.
|
| |
|
|
|
|
| |
completion
TODO: Still need to add a bunch of tests for path competion and more tests for all of the above mentioned completion cases.
|
| |
|
|
| |
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
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
| |
Changing to alpha version just to avoid confusion with release in PyPI
|