diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-07-30 20:12:39 -0400 |
---|---|---|
committer | anselor <anselor@gmail.com> | 2020-08-04 13:38:08 -0400 |
commit | 201e27ba23293cde3cf0e1bc8026b7442852c308 (patch) | |
tree | e46bf947f9b409b3d59320fec84269976d92e538 /cmd2 | |
parent | 659d1660b3d0435eaaabfbf74ab49bea7636da10 (diff) | |
download | cmd2-git-201e27ba23293cde3cf0e1bc8026b7442852c308.tar.gz |
Updated documentation
Diffstat (limited to 'cmd2')
-rw-r--r-- | cmd2/argparse_custom.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cmd2/argparse_custom.py b/cmd2/argparse_custom.py index 4c417a6d..39ce81f4 100644 --- a/cmd2/argparse_custom.py +++ b/cmd2/argparse_custom.py @@ -537,8 +537,16 @@ argparse.ArgumentParser._match_argument = _match_argument_wrapper # Patch argparse._SubParsersAction to add remove_parser function ############################################################################################################ -def _SubParsersAction_remove_parser(self, name): - """Removes a sub-parser from a sub-parsers group""" +def _SubParsersAction_remove_parser(self, name: str): + """ + Removes a sub-parser from a sub-parsers group + + This is a custom method being added to the argparse._SubParsersAction + class so cmd2 can remove subcommands from a parser. + + :param self: instance of the _SubParsersAction being edited + :param name: name of the sub-parser to remove + """ for choice_action in self._choices_actions: if choice_action.dest == name: self._choices_actions.remove(choice_action) |