Releases: andrewrosss/multicommand
1.0.0
0.1.1
0.1.0
-
Make sure to always initialize a root index parser (if one doesn't already exist) so that
multicommand.create_parser(...)
always returns a useable ArgumentParser (instead of raising an exception).This way
multicommand.create_parser(...)
can be called on a package that has no parsers, and will still behave sensibly. -
Check that found parsers are actually (sub-classes of)
ArgumentParser
, skip them if they aren't. -
Fix bug in
_requires_subparsers
-
Improve help for subcommands
0.0.8
- Fix: Fix
prog=...
for intermediate index parsers. Prior to this these parsers would only show the command name (sys.argv[0]
) and the last parser's name, but none of the intermediate parser's names, which meant the usage string was wrong. - Update: Add a license (MIT)
- Update: Change registry data structure from
List[Tuple[PurePath, ArgumentParser]] -> OrderedDict[PurePath, Dict[str, ArgumentParser]]
0.0.7
Documentation release
0.0.6
- Update: Refactored
multicommand.py
to simplify the structure of thecreate_parser(...)
function. Moreover, the keys in the parser registry (OrderedDict) are nowpathlib.PurePath
objects instead of tuples. The motivation for this change was because the registry keys (Tuple[str, ...]
objects) were already basically being treated likepathlib.Path
objects and it made the registry key manipulation easier to read and understand. - Update:
pyproject.toml
(added keywords)
0.0.5
- Update:
load_parsers
now usespkg.__name__
when loading parsers into the parser registry (OrderedDict). Prior to this, the valuecommands
was hardcoded meaning that for multicommand to work the subpackage housing all of the parsers had to be calledmypkg.<blah>.commands
. - Update: Documentation
- General housekeeping: Fixed typos, fixed broken links, added PyPI badge, etc.
0.0.4
-
Fix: Fixed the scenario where "intermediate" commands were not defined. When that happened multicommand wouldn't have intermediate parsers to link terminal parsers to the root parser.
Specifically, if there was say a single command defined as:
commands/mytopic/mycommand/mysubcommand.py
(with appropriate__init__.py
files)multicommand
would crash, because the index parsers required to exist "between" the parser defined inmysubcommand.py
and the root parser (created by multicommand) weren't getting created, and the application would crash.
This release also adds a very basic README and a simple example demonstrating the basic usage of multicommand
.
0.0.3
- Update: Forward parser config on subparser creation
- Update: Add custom
prog=...
when linking parsers to accurately reflect the expected command invocation - Maintenance: Add comments, clean up type hints, update
pyproject.toml
0.0.2
Hello, World!