File tree Expand file tree Collapse file tree 4 files changed +15
-5
lines changed Expand file tree Collapse file tree 4 files changed +15
-5
lines changed Original file line number Diff line number Diff line change
1
+ ## 2.1.1 (TBD, 2021)
2
+ * Bug Fixes
3
+ * Fixed handling of argparse's default options group name which was changed in Python 3.10
4
+
1
5
## 2.1.0 (June 14, 2021)
2
6
* Enhancements
3
7
* Converted persistent history files from pickle to compressed JSON
Original file line number Diff line number Diff line change @@ -975,7 +975,12 @@ def format_help(self) -> str:
975
975
976
976
# positionals, optionals and user-defined groups
977
977
for action_group in self ._action_groups :
978
- if action_group .title == 'optional arguments' :
978
+ if sys .version_info >= (3 , 10 ):
979
+ default_options_group = action_group .title == 'options'
980
+ else :
981
+ default_options_group = action_group .title == 'optional arguments'
982
+
983
+ if default_options_group :
979
984
# check if the arguments are required, group accordingly
980
985
req_args = []
981
986
opt_args = []
@@ -992,7 +997,7 @@ def format_help(self) -> str:
992
997
formatter .end_section ()
993
998
994
999
# now display truly optional arguments
995
- formatter .start_section (action_group . title )
1000
+ formatter .start_section ('optional arguments' )
996
1001
formatter .add_text (action_group .description )
997
1002
formatter .add_arguments (opt_args )
998
1003
formatter .end_section ()
Original file line number Diff line number Diff line change @@ -131,8 +131,9 @@ def __init__(
131
131
validation using str_to_bool(). The val_type function should raise an exception if it fails.
132
132
This exception will be caught and printed by Cmd.do_set().
133
133
:param description: string describing this setting
134
- :param settable_object: Object to configure with the set command
135
- :param settable_attrib_name: Attribute name to be modified. Defaults to `name` if not specified.
134
+ :param settable_object: object to which the instance attribute belongs (e.g. self)
135
+ :param settable_attrib_name: name which displays to the user in the output of the set command.
136
+ Defaults to `name` if not specified.
136
137
:param onchange_cb: optional function or method to call when the value of this settable is altered
137
138
by the set command. (e.g. onchange_cb=self.debug_changed)
138
139
Original file line number Diff line number Diff line change 52
52
53
53
# General information about the project.
54
54
project = 'cmd2'
55
- copyright = '2010-2020 , cmd2 contributors'
55
+ copyright = '2010-2021 , cmd2 contributors'
56
56
author = 'cmd2 contributors'
57
57
58
58
# The version info for the project you're documenting, acts as replacement for
You can’t perform that action at this time.
0 commit comments