Routes to the correct command line tool
(self, args=None)
| 430 | self.error_exit_codes = error_exit_codes |
| 431 | |
| 432 | def __call__(self, args=None): |
| 433 | """Routes to the correct command line tool""" |
| 434 | self.api._ensure_started() |
| 435 | args = sys.argv if args is None else args |
| 436 | if not len(args) > 1 or not args[1] in self.commands: |
| 437 | print(str(self)) |
| 438 | return sys.exit(1) |
| 439 | |
| 440 | command = args.pop(1) |
| 441 | result = self.commands.get(command)() |
| 442 | |
| 443 | if self.error_exit_codes and bool(strtobool(result.decode("utf-8"))) is False: |
| 444 | sys.exit(1) |
| 445 | |
| 446 | def handlers(self): |
| 447 | """Returns all registered handlers attached to this API""" |
no test coverage detected