def main(): try: # Create the top-level parser desc = "Command line interface to the lunr api" parser = SubCommandParser([Backup(), Volume(), Env(), Node(), Export(), Account()], desc=desc) # execute the command requested return parser.run() except LunrHttpError as e: print("Code: %s - %s" % (e.code, e.msg)) print(str(e)) except LunrError as e: print(str(e)) except ShellError as e: print(e.msg) return e.help() return 1
def setUp(self): self.parser = SubCommandParser([Api()])