- Switch from Travis to GitHub Actions.
- Add support for async handlers (per #13).
- Fix #11: multiword optional args of any type other than
bool
couldn't be used.
- Global args are now stored in
self.global_args
instead ofself._root_args
. - Global args are now available in nested commands. Read more.
- Commands can now access root command args via
self._root_args
. Read more.
- Add support for nested commands. Read more.
- Fix incorrect mapping from handler params to optional CLI args.
- Prepare for postponed annotation evaluation, which will be the default in Python 4.0 (see #2).
- Add
show_defaults
param toset_help
util. Read more.
- Fix Python 3.7 incompatibility.
- Add
set_sharg_map
to override or disable short arg names.
- Make
_root
not an abstract method.
- Fix critical bug that disallowed string params.
- Boolean handler params are converted into
store_true
arguments. Before that, params with default value ofTrue
were much confusingly converted intostore_false
arguments. - Support
List[int]
and similar arg types. If the param type is a subclass oftyping.Iterable
and has a type specified in brackets, it's converted into multivalue arg of the type in the brackets. - Do not print help whenever
_root
command is invoked. - Convert the
cliar
module into a package. - Add tests.
- Switch to Poetry.
- Add the ability to set help messages for arguments.
- Add the ability to set metavars for arguments.
- [Breaks backward compatibility] Base CLI class renamed from
CLI
toCliar
. - Fixed a bug where commandline args with dashes weren't mapped to corresponding param names with underscores.
- Add the ability to override mapping between commandline args and and handler params. By default, handler params correspond to args of the same name with underscores replaced with dashes.
- Underscores in handler names are now replaced with dashes when the corresponding command name is generated.
- Optional arguments are now prepended with '--', not '-'.
- Short argument names are now generated from the long ones:
name
handler arg corresponds to-n
and--name
commandline args. - Python 2 support dropped. Python 3.5+ required.
- Code refactored, type hints added.
- Code improvements for API documentation.
- Code cleanup.
- Setup: Python version check improved.
- Python 2: If only the _root handler was defined, a "too few agruments" error raised. Fixed.
- If only the _root handler is defined, the commands subparser is not added anymore.
- Packaging improved, the installation package now includes both Python 2 and 3 sources.
- Command descriptions did not preserve line breaks from docstrings. Fixed.
- Commands now use the first docstring line as help and the whole docstring as description.
- Description and help texts now preserve line breaks from docstrings.
- Support of multiple values for a single arg added.
- Command-line args are now parsed by explicitly calling the
.parse()
method.
- The
ignore
decorator added to exclude a method from being converted into a command.
- Nested CLI methods would not override parent methods. Fixed.
- Python 2 support added.
- Docstring added to the add_aliases function.
- The set_name function is now less hacky.
- Alias support added with the "add_aliases" decorator.
- First version. Changelog started.