Skip to content

Commit ec9a2fc

Browse files
committed
No longer setting parser's prog value in with_argparser() since it gets set in Cmd._build_parser().
1 parent 71c4130 commit ec9a2fc

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

cmd2/decorators.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -393,14 +393,6 @@ def cmd_wrapper(*args: Any, **kwargs: dict[str, Any]) -> Optional[bool]:
393393

394394
command_name = func.__name__[len(constants.COMMAND_FUNC_PREFIX) :]
395395

396-
if isinstance(parser, argparse.ArgumentParser):
397-
# Set parser's prog value for backward compatibility within the cmd2 2.0 family.
398-
# This will be removed in cmd2 3.0 since we never reference this parser object's prog value.
399-
# Since it's possible for the same parser object to be passed into multiple with_argparser()
400-
# calls, we only set prog on the deep copies of this parser based on the specific do_xxxx
401-
# instance method they are associated with.
402-
_set_parser_prog(parser, command_name)
403-
404396
# Set some custom attributes for this command
405397
setattr(cmd_wrapper, constants.CMD_ATTR_ARGPARSER, parser)
406398
setattr(cmd_wrapper, constants.CMD_ATTR_PRESERVE_QUOTES, preserve_quotes)

0 commit comments

Comments
 (0)