def run_from_argv(self, prog_name, argv): self.prog_name = prog_name self.command = argv[0] self.arglist = argv[1:] self.parser = self.create_parser(self.prog_name, self.command) options, args = self.parser.parse_args(self.arglist) self.colored = term.colored(enabled=not options.no_color) self(*args, **options.__dict__)
def __init__(self, app=None, no_color=False): self.app = app_or_default(app) self.colored = term.colored(enabled=not no_color)