Skip to content

Commit 201e27b

Browse files
kmvanbruntanselor
authored andcommitted
Updated documentation
1 parent 659d166 commit 201e27b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

cmd2/argparse_custom.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,16 @@ def _match_argument_wrapper(self, action, arg_strings_pattern) -> int:
537537
# Patch argparse._SubParsersAction to add remove_parser function
538538
############################################################################################################
539539

540-
def _SubParsersAction_remove_parser(self, name):
541-
"""Removes a sub-parser from a sub-parsers group"""
540+
def _SubParsersAction_remove_parser(self, name: str):
541+
"""
542+
Removes a sub-parser from a sub-parsers group
543+
544+
This is a custom method being added to the argparse._SubParsersAction
545+
class so cmd2 can remove subcommands from a parser.
546+
547+
:param self: instance of the _SubParsersAction being edited
548+
:param name: name of the sub-parser to remove
549+
"""
542550
for choice_action in self._choices_actions:
543551
if choice_action.dest == name:
544552
self._choices_actions.remove(choice_action)

0 commit comments

Comments
 (0)