Skip to content

Commit

Permalink
Merge pull request #12 from mckaymatt/add-BooleanOptionalAction-action
Browse files Browse the repository at this point in the history
Add builtin BooleanOptionalAction Action
  • Loading branch information
fmenabe committed May 20, 2022
2 parents bf0c607 + 954a523 commit 7724bc1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
---------

3.1.1 (2022-05-19)
~~~~~~~~~~~~~~~~~~

* Add builtin BooleanOptionalAction Action.
https://docs.python.org/3/library/argparse.html?highlight=argparse#action

3.1.0 (2021-11-30)
~~~~~~~~~~~~~~~~~~

Expand Down
4 changes: 4 additions & 0 deletions clg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
_GRP_METHODS = {'groups': 'add_argument_group',
'exclusive_groups': 'add_mutually_exclusive_group'}

# Add builtin BooleanOptionalAction Action.
# https://docs.python.org/3/library/argparse.html?highlight=argparse#action
if sys.version_info >= (3, 9):
ACTIONS.update(BooleanOptionalAction=argparse.BooleanOptionalAction)

#
# Exceptions.
Expand Down
3 changes: 3 additions & 0 deletions doc/source/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,9 @@ For example, to add an action that page help (using the `less -c` command):
.. note:: The `page_help` action is implemented and added by default in the
``clg`` module so you can use it without redefining it.
.. note:: `argparse.BooleanOptionalAction` is added by default in ``clg`` and
adds support for boolean actions such as `--foo` and `--no-foo`. It can be
activated with `action: BooleanOptionalAction`. Requires Python3.9 or greater.
version
~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name='clg',
version='3.1.0',
version='3.1.1',
author='François Ménabé',
author_email='francois.menabe@gmail.com',
url='https://clg.readthedocs.org/en/latest/',
Expand Down

0 comments on commit 7724bc1

Please sign in to comment.