'sends the command to the CLI to be executed'

def cli_execute(self, cmd):

    try:
        args = parse_quotes(cmd)
        azlogging.configure_logging(args)
        if ((len(args) > 0) and (args[0] == u'feedback')):
            SHELL_CONFIGURATION.set_feedback(u'yes')
            self.user_feedback = False
        azure_folder = get_config_dir()
        if (not os.path.exists(azure_folder)):
            os.makedirs(azure_folder)
        ACCOUNT.load(os.path.join(azure_folder, u'azureProfile.json'))
        CONFIG.load(os.path.join(azure_folder, u'az.json'))
        SESSION.load(os.path.join(azure_folder, u'az.sess'), max_age=3600)
        if (u'--progress' in args):
            args.remove(u'--progress')
            execute_args = [args]
            thread = Thread(target=self.app.execute, args=execute_args)
            thread.daemon = True
            thread.start()
            self.threads.append(thread)
            self.curr_thread = thread
            progress_args = [self]
            thread = Thread(target=progress_view, args=progress_args)
            thread.daemon = True
            thread.start()
            self.threads.append(thread)
            result = None
        else:
            result = self.app.execute(args)
        self.last_exit = 0
        if (result and (result.result is not None)):
            from azure.cli.core._output import OutputProducer
            if self.output:
                self.output.write(result)
                self.output.flush()
            else:
                formatter = OutputProducer.get_formatter(self.app.configuration.output_format)
                OutputProducer(formatter=formatter).out(result)
                self.last = result
    except Exception as ex:
        self.last_exit = handle_exception(ex)
    except SystemExit as ex:
        self.last_exit = int(ex.code)
