Exemple #1
0
    def format_option_strings(self, option):
        if hasattr(option, "subopt") and option.subopt:
            res = '-o ' + option.subopt
            if option.takes_value():
                res += "="
                res += option.metavar or 'FOO'
            return res

        return HelpFormatter.format_option_strings(self, option)
Exemple #2
0
    def format_option_strings(self, option):
        if hasattr(option, "subopt") and option.subopt:
            res = '-o ' + option.subopt
            if option.takes_value():
                res += "="
                res += option.metavar or 'FOO'
            return res

        return HelpFormatter.format_option_strings(self, option)
Exemple #3
0
 def format_option_strings(self, option):
     if isinstance(option, GroupOption):
         if option.takes_value():
             metavar = option.metavar or option.dest.upper()
             return '%s=%s' % (
                 option._long_opts[0],
                 metavar,
             )
         else:
             return option._long_opts[0]
     else:
         return HelpFormatter.format_option_strings(self, option)
Exemple #4
0
 def format_option_strings(self, option):
     if isinstance(option, GroupOption):
         if option.takes_value():
             metavar = option.metavar or option.dest.upper()
             return '%s=%s' % (
               option._long_opts[0],
               metavar,
             )
         else:
             return option._long_opts[0]
     else:
         return HelpFormatter.format_option_strings(self, option)