CMS 3D CMS Logo

List of all members | Private Member Functions
argparse.ArgumentDefaultsHelpFormatter Class Reference
Inheritance diagram for argparse.ArgumentDefaultsHelpFormatter:
argparse.HelpFormatter

Private Member Functions

def _get_help_string (self, action)
 

Additional Inherited Members

- Public Member Functions inherited from argparse.HelpFormatter
def __init__ (self, prog, indent_increment=2, max_help_position=24, width=None)
 
def add_argument (self, action)
 
def add_arguments (self, actions)
 
def add_text (self, text)
 
def add_usage (self, usage, actions, groups, prefix=None)
 
def end_section (self)
 
def format_help (self)
 
def start_section (self, heading)
 

Detailed Description

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.

Definition at line 666 of file argparse.py.

Member Function Documentation

def argparse.ArgumentDefaultsHelpFormatter._get_help_string (   self,
  action 
)
private

Definition at line 673 of file argparse.py.

673  def _get_help_string(self, action):
674  help = action.help
675  if '%(default)' not in action.help:
676  if action.default is not SUPPRESS:
677  defaulting_nargs = [OPTIONAL, ZERO_OR_MORE]
678  if action.option_strings or action.nargs in defaulting_nargs:
679  help += ' (default: %(default)s)'
680  return help
681 
682 
683 # =====================
684 # Options and Arguments
685 # =====================
686