[docs]defrun(self,args=None):""" Runs the command passing in the parsed arguments. If an ``OasisException`` is raised the exception is caught, the error is logged and the process exits with an error code of 1. :param args: The arguments to run the command with. If ``None`` the arguments are gathered from the argument parser. This is automatically set when calling sub commands and in most cases should not be set for the root command. :type args: Namespace :return: The status code of the action (0 on success) """try:returnsuper(OasisBaseCommand,self).run(args=args)exceptOasisExceptionase:ifself.log_verbose:# Log with tracebackself.logger.exception(str(e))else:self.logger.error(str(e))return1
[docs]defmain():"""CLI entrypoint for running the whole RootCmd"""sys.exit(RootCmd().run())