(self, action)
| 552 | return self._join_parts(parts) |
| 553 | |
| 554 | def _format_action_invocation(self, action): |
| 555 | if not action.option_strings: |
| 556 | metavar, = self._metavar_formatter(action, action.dest)(1) |
| 557 | return metavar |
| 558 | |
| 559 | else: |
| 560 | parts = [] |
| 561 | |
| 562 | # if the Optional doesn't take a value, format is: |
| 563 | # -s, --long |
| 564 | if action.nargs == 0: |
| 565 | parts.extend(action.option_strings) |
| 566 | |
| 567 | # if the Optional takes a value, format is: |
| 568 | # -s ARGS, --long ARGS |
| 569 | else: |
| 570 | default = action.dest.upper() |
| 571 | args_string = self._format_args(action, default) |
| 572 | for option_string in action.option_strings: |
| 573 | parts.append('%s %s' % (option_string, args_string)) |
| 574 | |
| 575 | return ', '.join(parts) |
| 576 | |
| 577 | def _metavar_formatter(self, action, default_metavar): |
| 578 | if action.metavar is not None: |
no test coverage detected