def main_help_text(self,argv=None): """ Returns the script's main help text, as a string. """ import thepian prog_name = os.path.basename(argv[0]) style = color_style() usage = [ style.HEADING('%s <subcommand> [options] [args]' % prog_name), 'Thepian command line tool, version %s' % thepian.get_version(), "Type '%s help <subcommand>' for help on a specific subcommand." % prog_name, 'Available subcommands:', ] commands = self.get_commands().keys() commands.sort() return '\n'.join(usage + [' %s' % cmd for cmd in commands])
def __init__(self): self.style = color_style()
def get_style(self): return getattr(self.cmd,'style',color_style())