MCPcopy Create free account
hub / github.com/apache/madlib / ArgumentDefaultsHelpFormatter

Class ArgumentDefaultsHelpFormatter

src/madpack/argparse.py:678–692  ·  view source on GitHub ↗

Help message formatter which adds default values to argument help. Only the name of this class is considered a public API. All the methods provided by the class are considered an implementation detail.

Source from the content-addressed store, hash-verified

676
677
678class ArgumentDefaultsHelpFormatter(HelpFormatter):
679 """Help message formatter which adds default values to argument help.
680
681 Only the name of this class is considered a public API. All the methods
682 provided by the class are considered an implementation detail.
683 """
684
685 def _get_help_string(self, action):
686 help = action.help
687 if '%(default)' not in action.help:
688 if action.default is not SUPPRESS:
689 defaulting_nargs = [OPTIONAL, ZERO_OR_MORE]
690 if action.option_strings or action.nargs in defaulting_nargs:
691 help += ' (default: %(default)s)'
692 return help
693
694
695# =====================

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected