Esempio n. 1
0
    def format_help(self, formatter=None):
        """ Create a help text based on the options defined.
        The -- that is added to the options is automatically removed """
        class Positional(object):
            def __init__(self, args):
                self.option_groups = []
                self.option_list = args

        positional = Positional(self.positional)
        formatter = IndentedHelpFormatter()
        formatter.store_option_strings(positional)
        output = ['\n', formatter.format_heading("Commands")]
        formatter.indent()
        pos_help = [formatter.format_option(opt) for opt in self.positional]
        pos_help = [line.replace('--', '') for line in pos_help]
        output += pos_help
        return OptionGroup.format_help(self, formatter) + ''.join(output)
Esempio n. 2
0
 def format_help(self, formatter):
     if not self.suppress_help:
         return OptionGroup.format_help(self, formatter)
     else:
         return ""
 def format_help(self, formatter):
     if not self.suppress_help:
         return OptionGroup.format_help(self, formatter)
     else:
         return ""