CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 

Additional Inherited Members

- Public Member Functions inherited from argparse.HelpFormatter
def __init__
 
def add_argument
 
def add_arguments
 
def add_text
 
def add_usage
 
def end_section
 
def format_help
 
def start_section
 

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.

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