def format_option_strings(self, option): """Extend option string formatting to support arguments for commands""" if option.action == 'command' and not option.args == 'no': arg_name = option.metavar or _('indices') if option.args == 'optional': arg_name = ''.join(['[', arg_name, ']']) lopts = [' '.join([lopt, arg_name]) for lopt in option._long_opts] return ', '.join(lopts) else: return IndentedHelpFormatter.format_option_strings(self, option)
def format_option_strings(self, option): rv = IndentedHelpFormatter.format_option_strings(self, option) if hasattr(option, '_negative_version'): rv += ' / ' + IndentedHelpFormatter.format_option_strings( self, option._negative_version) return rv