code: def run(self):
          "Run cli, processing arguments and executing subcommands."
          arguments = self.argument_parser.parse_args()
          argspec = inspect.getargspec(arguments.func)
          vargs = []
          for arg in argspec.args:
              vargs.append(getattr(arguments, arg))
          if argspec.varargs:
              vargs.extend(getattr(arguments, argspec.varargs))
          output = arguments.func(*vargs)
          if getattr(arguments.func, '_cli_test_command', False):
              self.exit_code = 0 if output else 1
              output = ''
          if getattr(arguments.func, '_cli_no_output', False):
              output = ''
          self.formatter.format_output(output, arguments.format)
          if charmhelpers.core.unitdata._KV:
              charmhelpers.core.unitdata._KV.flush(f run(self):
          "Run cli, processing arguments and executing subcommands."
          arguments = self.argument_parser.parse_args()
          argspec = inspect.getargspec(arguments.func)
          vargs = []
          for arg in argspec.args:
              vargs.append(getattr(arguments, arg))
          if argspec.varargs:
              vargs.extend(getattr(arguments, argspec.varargs))
          output = arguments.func(*vargs)
          if getattr(arguments.func, '_cli_test_command', False):
              self.exit_code = 0 if output else 1
              output = ''
          if getattr(arguments.func, '_cli_no_output', False):
              output = ''
          self.formatter.format_output(output, arguments.format)
          if charmhelpers.core.unitdata._KV:
              charmhelpers.core.unitdata._KV.flush()
docs: Run cli, processing arguments and executing subcommands.