File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
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 optionals group name that 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 @@ -973,9 +973,14 @@ def format_help(self) -> str:
973
973
974
974
# Begin cmd2 customization (separate required and optional arguments)
975
975
976
+ if sys .version_info >= (3 , 10 ):
977
+ default_optionals_title = 'options'
978
+ else :
979
+ default_optionals_title = 'optional arguments'
980
+
976
981
# positionals, optionals and user-defined groups
977
982
for action_group in self ._action_groups :
978
- if action_group .title == 'optional arguments' :
983
+ if action_group .title == default_optionals_title :
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
You can’t perform that action at this time.
0 commit comments