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

Method format_option_help

Lib/optparse.py:1597–1612  ·  view source on GitHub ↗
(self, formatter=None)

Source from the content-addressed store, hash-verified

1595 print(self.get_version(), file=file)
1596
1597 def format_option_help(self, formatter=None):
1598 if formatter is None:
1599 formatter = self.formatter
1600 formatter.store_option_strings(self)
1601 result = []
1602 result.append(formatter.format_heading(_("Options")))
1603 formatter.indent()
1604 if self.option_list:
1605 result.append(OptionContainer.format_option_help(self, formatter))
1606 result.append("\n")
1607 for group in self.option_groups:
1608 result.append(group.format_help(formatter))
1609 result.append("\n")
1610 formatter.dedent()
1611 # Drop the last "\n", or the header if no options or option groups:
1612 return "".join(result[:-1])
1613
1614 def format_epilog(self, formatter):
1615 return formatter.format_epilog(self.epilog)

Callers 1

format_helpMethod · 0.95

Calls 8

store_option_stringsMethod · 0.80
_Function · 0.50
appendMethod · 0.45
format_headingMethod · 0.45
indentMethod · 0.45
format_helpMethod · 0.45
dedentMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected