MCPcopy Index your code
hub / github.com/python/cpython / format_help

Method format_help

Lib/argparse.py:2786–2808  ·  view source on GitHub ↗
(self, formatter=None)

Source from the content-addressed store, hash-verified

2784 return formatter.format_help()
2785
2786 def format_help(self, formatter=None):
2787 if formatter is None:
2788 formatter = self._get_formatter()
2789
2790 # usage
2791 formatter.add_usage(self.usage, self._actions,
2792 self._mutually_exclusive_groups)
2793
2794 # description
2795 formatter.add_text(self.description)
2796
2797 # positionals, optionals and user-defined groups
2798 for action_group in self._action_groups:
2799 formatter.start_section(action_group.title)
2800 formatter.add_text(action_group.description)
2801 formatter.add_arguments(action_group._group_actions)
2802 formatter.end_section()
2803
2804 # epilog
2805 formatter.add_text(self.epilog)
2806
2807 # determine help from format above
2808 return formatter.format_help()
2809
2810 def _get_formatter(self, file=None):
2811 formatter = self.formatter_class(prog=self.prog)

Callers 15

mainFunction · 0.95
_parse_argsFunction · 0.95
print_helpMethod · 0.95
_parse_argsFunction · 0.95
test_argparse_colorMethod · 0.95

Calls 7

_get_formatterMethod · 0.95
add_usageMethod · 0.80
add_textMethod · 0.80
start_sectionMethod · 0.80
add_argumentsMethod · 0.80
end_sectionMethod · 0.80
format_helpMethod · 0.45