| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Copied 3.5.4 definition of typing.Deque
|
|
|
|
| |
constructor
|
|
|
|
|
|
| |
CommandSet now has a check to ensure it is only registered with one
cmd2.Cmd instance at a time.
Adds function to find command set by type and by command name
|
| |
|
| |
|
|
|
|
|
| |
Changed alias and macro commands to use as_subcommand_to() decorator.
Updated CommandSet subcommand example to use help and description text.
|
|
|
|
| |
Fixed missing settings in subcommand parsers created with as_subcommand_to() decorator.
|
|
|
|
|
|
|
|
|
|
| |
passing it a CommandSet instance.
Search for a CommandSet instance that matches the completer's parent
class type.`
Resolves Issue #967
Renamed isolated_tests directory to tests_isolated for better visual grouping. Added some exception documentation
|
|
|
|
| |
implementation as an option to with_argparser instead.
|
|
|
|
| |
passing to command handlers to access sub-command handlers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
through to the ArgparseCompleter if one is registered.
For subcommands, the registered argparse instance for the subcommand is now tagged with the
CommandSet from which it originated.
If a CommandSet is detected, it's now passed in as 'self' for the
completion functions.
Fixes some issue found with removing a subcommand.
Adds additional tests.
Added a check to prevent removal of a CommandSet if it has commands with sub-commands
from another CommandSet bound to it.
Documentation improvements.
Standardized around using CommandSetRegistrationException during commandset install/uninstall related errors.
Added support for nested sub-command injection.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
sub-commande => subcommand
Added help/aliases to `as_subcommand_to` decorator.
|
| |
|
|
|
|
|
|
| |
load/unload.
Updated examples and documentation to include discussion of injectable
sub-commands.
|
|
|
|
| |
Added additional documentation
|
|
|
|
|
|
|
|
|
|
| |
register arbitrary functions as commands.
Added example that demonstrates use of each of the command decorators
with CommandSets.
Adds unit test that verifies that CommandSets containing decorators load
and process commands correctly.
Updated the constructor declaration for Cmd2ArgumentParser to explicitly
re-declare argparse constructor parameters.
|
| |
|
| |
|
|
|
|
| |
scenarios where inspect.ismethod() fails for some reason
|
| |
|
| |
|
| |
|
|
|
|
| |
functions.
|
| |
|
|
|
|
|
|
| |
command functions
Adds handling of some edge cases. More thorough test coverage.
|
|
|
|
| |
Issue #943
|
|
|
|
|
|
| |
Added unit tests. Moved installing commands into separate functions that can be called
Issue #943
|
|
|
|
|
|
| |
for CommandSet commands.
Issue #943
|
|
|
|
|
|
|
|
|
|
| |
Issue #943
New class CommandSet can be used to tag a class as a command class. If
the constructor is simple, the object will automatically be instantiated
and loaded.
New register_command decorator to tag any arbitrary function as a
command.
|
| |
|
|
|
|
|
|
|
| |
Cleaned up docstring in external test plugin
Updated some initialization to match new approach for version info discovery.
Tagged some IDE-only lines as no-cover
Adds plugin coverage reporting.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Importing pkg_resources has a side-effect of scanning every installed
distribution on sys.path to load the metadata, especially the entry
points defined in the packages. This can have a significant
launch-time cost for command line applications when there are a lot of
distributions to scan.
Since cmd2 is only using pkg_resources to find the version of the
installed package, pkg_resources can be replaced with
importlib.metadata. The implementation in the new library is
significantly faster because it goes immediately to the metadata file
for the requested distribution, instead of scanning all of them. There
are also no import-time side-effects.
importlib.metadata is a new standard library module starting with
python 3.8. For earlier versions, a compatible library has been
released to PyPI as 'importlib_metadata'. This change adds the new
dependency with a qualifier so that it is only applied to older
versions of python, and then updates the places that were importing
pkg_resources to look for the different versions of the new library
instead. The documentation configuration is changed to import cmd2
itself to get its version, since the package has to be installed for
the metadata to be available anyway.
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| | |
Added unit tests
|
| |
| |
| |
| |
| | |
1. Added SystemExit handling by warning the user it's occured and setting stop to True
2. KeyboardInterrupts won't be raised if stop is already set to True.
|
| |
| |
| |
| | |
Both exception classes have been added to the public API.
|