- Allow default parameter of an option to be an empty list (3a99af3)
- Manage boolean values in post checks (need/conflict; 092fbce)
- Allow to pass args to the init function (d047652)
- Revert an uncommitted test while previously pushing the package. The test was
replacing dashes by underscores in
execute
module's name.
- Add support of typing #13
- Add builtin BooleanOptionalAction Action. https://docs.python.org/3/library/argparse.html?highlight=argparse#action
- Replace deprecated
imp
module withhimportlib
before it is dropped in Python 3.10. pep-0594 - Drop Python 2 support.
- Allow
__FILE__
builtin with thefile
argument toexecute
.
Add an
init
function to the module that initialize the CommandLine object and set some variables in the module namespace (this is required for someclg
plugins and simplify the usage); 43fefa6).Namespace changes:
- Access to an element in the namespace now raise an exception based on the syntax used (AttributeError or KeyError). To access an element which may not exists, a _get method has been implement based on dict.get (_get(args, default=None)).
- Arguments can be deleted (d37fcc7).
Allow deletion of keys in the arguments Namespace (d37fcc7)
Force escaping of percent characters in help message. (b8665b1).
Correct and improve the
help
command (added by theadd_help_cmd
parameter):Improve
need
andconflict
post checks for checking values of options (436e670, b077f75).
- Add some additionnal checks (for the main configuration and types; bbcff61, dd21371).
- Correct a bug where some commands number in the resulted Namespace were skipped (6ec1abc).
- Add subparsers after args and options for improved behaviour (4c4471c).
- Add a '-p/--page' option to the
help
command (added by the add_help_cmd parameter) allowing to page the output (8b2d9fd). - Remove obsolete script for generating bash and zsh completion (b7a06fb).
- Fix a bug that prevented the completion (using
argcomplete) to work when
print_help
is used (d2590f7). - Fix a bug that prevented paging of the help (behaviour induced by the
page_help
parameter) when the
help
option was not defined manually (0a1a0b4). - Add the
completer
parameter for options and arguments allowing to manage argcomplete completers (20c8461). - Update documentation for argcomplete (66ad52a).
- Add a
negative_value
parameter for parsers allowing to redefine how negatives values are distinguished from options (4c7e7be).
print_help
parameter is not anymore a root parameter but a per command parameter and simulate the use of the --help option if no arguments are supplied (6bee4d9). This allows flexibiliy for (sub)commands that do not require any input.
- Remove empty list for default value when
nargs
is set to * or + (4102816). - Allows to add custom actions by updating
ACTIONS
dictionnary (65d7480). - Add a
page_help
action allowing to page help (818383b, f788f35). - Add the parameter
page_help
at the root of the configuration allowing to page the help of all commands (by replacing the defaulthelp
action by thepage_help
action; 9454f7a). - Add the parameter
print_help
at the root of the configuration allowing to print help when no arguments is set (also work for subcommands; 5ea6fe8)
- Change behaviour of groups: groups now act like parsers rather than just referencing previously defined options. It breaks files used by previous versions.
- Update design and correct bugs of the
help
command added by the add_help_cmd keyword. - Improve control of abbrevations behaviour. When
allow_abbrev
parameter was activate, it was not possible to concatenate single options or split with an '=' long options. This is now the case. - Correct a bug with YAML anchors which causes loss of informations (like the short option).
- Correct a bug when using
version
action.
- Add a
version
keyword for options, allowing to useversion
action.- Allow an option
add_help_cmd
in the root of the configuration that automatically add ahelp
command that show the arborescence of all commands with their descriptions.- Allow the use of
argparse.SUPPRESS
with__SUPPRESS__
"builtin".- Replace the "builtins" __CHOICES__, __MATCH__ and __FILE__ in the help message by the respectives values of those keywords.
- Add the parameter
allow_abbrev
in parser configuration, controlling abbrevations behaviour (http://bugs.python.org/issue14910).
- Rewrite module for matching at best
argparse
.- Allow bultins.
- Drop compatibility to python2.6 (because of dict comprehension).
- Port code to Python 3 (with compatiblity at least until Python 2.6).
- Add description of parser (via desc keyword).
- Add an iterable and accessible namespace for arguments.
- Change behaviour of parse method (now return a namespace with arguments).
- Set the default value for list type to an empty list.
- Changes the behaviour of the execution of an external module. It is no longer a python path of a module in 'sys.path' but directly the path of a file. In addition, keyword 'lib' has be replaced by 'path'.
- Replace '__FILE__' in the default value of an option by the directory of the program.
- Update the license to MIT.
- CommandLine object doesn't take anymore a JSON or YAML file but a dictionary.
- Add documentation.
- Updating setup for PyPi.