| 2701 | return formatter.format_help() |
| 2702 | |
| 2703 | def format_help(self): |
| 2704 | formatter = self._get_formatter() |
| 2705 | |
| 2706 | # usage |
| 2707 | formatter.add_usage(self.usage, self._actions, |
| 2708 | self._mutually_exclusive_groups) |
| 2709 | |
| 2710 | # description |
| 2711 | formatter.add_text(self.description) |
| 2712 | |
| 2713 | # positionals, optionals and user-defined groups |
| 2714 | for action_group in self._action_groups: |
| 2715 | formatter.start_section(action_group.title) |
| 2716 | formatter.add_text(action_group.description) |
| 2717 | formatter.add_arguments(action_group._group_actions) |
| 2718 | formatter.end_section() |
| 2719 | |
| 2720 | # epilog |
| 2721 | formatter.add_text(self.epilog) |
| 2722 | |
| 2723 | # determine help from format above |
| 2724 | return formatter.format_help() |
| 2725 | |
| 2726 | def _get_formatter(self): |
| 2727 | formatter = self.formatter_class(prog=self.prog) |