Send each command to the /history endpoint.
347164
def update_history(cloud_hero):
    
    user_command = ' '.join(sys.argv)
    timestamp = int(time.time())
    command = (user_command, timestamp)
    cloud_hero.send_history([command])
1008225
def issue_and_listen_to_command_history():
    """"""
    def tc_callback(rec):
        print('TC:', rec)

    command = processor.issue_command('/YSS/SIMULATOR/SWITCH_VOLTAGE_OFF', args={
        'voltage_num': 1,
    }, comment='im a comment')
    command.create_command_history_subscription(on_data=tc_callback)
127082
function (to, createHistoryEntry, triggerRoute, force, callback) {
                return this.history.navigate(to, createHistoryEntry, triggerRoute, force, callback);
            }
557421
function historyDirective($scope, History, Clients) {

        var ctrl = this;

        ctrl.visited = [];

        ctrl.utils = {};

        ctrl.utils.localUrl = function (path) {
            return [$scope.options.urls.local, path].join("");
        };

        ctrl.updateVisited = function (data) {
            ctrl.visited = data;
            $scope.$digest();
        };

        ctrl.sendAllTo = function (url) {
            url.success = true;
            Clients.sendAllTo(url.path);
            setTimeout(function () {
                url.success = false;
                $scope.$digest();
            }, 1000);
        };

        ctrl.removeVisited = function (item) {
            History.remove(item);
        };

        History.get().then(function (items) {
            ctrl.visited = items;
        });

        History.on("change", ctrl.updateVisited);

        $scope.$on("$destroy", function () {
            History.off(ctrl.updateVisited);
        });
    }
530871
def write_command(self, request_id, msg, docs):
        
        if self.publish:
            duration = datetime.datetime.now() - self.start_time
            self._start(request_id, docs)
            start = datetime.datetime.now()
        try:
            reply = self.sock_info.write_command(request_id, msg)
            if self.publish:
                duration = (datetime.datetime.now() - start) + duration
                self._succeed(request_id, reply, duration)
        except OperationFailure as exc:
            if self.publish:
                duration = (datetime.datetime.now() - start) + duration
                self._fail(request_id, exc.details, duration)
            raise
        finally:
            self.start_time = datetime.datetime.now()
        return reply
306247
function history(params, cb) {
  params.resourcePath = config.addURIParams(constants.STATS_BASE_PATH + "/history", params);
  params.method = 'POST';
  params.data = params.data || {};
  mbaasRequest.admin(params, cb);
}
552672
def cmdHISTORY(self, params):
        
        cnt = 0
        self.writeline('Command history\n')
        for line in self.history:
            cnt = cnt + 1
            self.writeline("%-5d : %s" % (cnt, ''.join(line)))
107501
def execute(self, cmd):
        """"""
        if not cmd.filePath in self._history.keys():
            self._history[cmd.filePath] = SubtitleUndoStack(self)
            try:
                self._history[cmd.filePath].push(cmd)
            except:
                self._history[cmd.filePath].deleteLater()
                del self._history[cmd.filePath]
                raise
            else:
                self._history[cmd.filePath].clear()
        else:
            self._history[cmd.filePath].push(cmd)
377719
def postloop(self):
        
        try:
            if readline:
                readline.write_history_file(sys.argv[0] + ".history")
        except Exception, err:
            if not isinstance(err, IOError):
                self.stdout.write("history error: %s\n" % err)

        # clean up command completion
        cmd.Cmd.postloop(self)

        if self.interactive:
            self.stdout.write("Exiting...\n")

        # tell the core we have stopped
        core.deferred(core.stop)
890928
def history(directory, rev_range, verbose, indicate_current):
    """"""
    _history(directory, rev_range, verbose, indicate_current)
798247
def set_history_file(self, path):
        """"""
        if path:
            self.history = prompt_toolkit.history.FileHistory(fixpath(path))
        else:
            self.history = prompt_toolkit.history.InMemoryHistory()
505763
def request(self, api_commands, *, timeout=None):
        """"""
        if not isinstance(api_commands, list):
            return self._execute(api_commands, timeout=timeout)

        command_results = []

        for api_command in api_commands:
            result = self._execute(api_command, timeout=timeout)
            command_results.append(result)

        return command_results
199060
def send(self, commands):
        ""
        if not commands.endswith("\n"):
            commands += "\n"
        self.sock.send(commands)
831095
def _generate_transcript(self, history: List[Union[HistoryItem, str]], transcript_file: str) -> None:
        """"""
        import io
        # Validate the transcript file path to make sure directory exists and write access is available
        transcript_path = os.path.abspath(os.path.expanduser(transcript_file))
        transcript_dir = os.path.dirname(transcript_path)
        if not os.path.isdir(transcript_dir) or not os.access(transcript_dir, os.W_OK):
            self.perror("{!r} is not a directory or you don't have write access".format(transcript_dir),
                        traceback_war=False)
            return

        try:
            with self.sigint_protection:
                # Disable echo while we manually redirect stdout to a StringIO buffer
                saved_echo = self.echo
                saved_stdout = self.stdout
                self.echo = False

            # The problem with supporting regular expressions in transcripts
            # is that they shouldn't be processed in the command, just the output.
            # In addition, when we generate a transcript, any slashes in the output
            # are not really intended to indicate regular expressions, so they should
            # be escaped.
            #
            # We have to jump through some hoops here in order to catch the commands
            # separately from the output and escape the slashes in the output.
            transcript = ''
            for history_item in history:
                # build the command, complete with prompts. When we replay
                # the transcript, we look for the prompts to separate
                # the command from the output
                first = True
                command = ''
                for line in history_item.splitlines():
                    if first:
                        command += '{}{}\n'.format(self.prompt, line)
                        first = False
                    else:
                        command += '{}{}\n'.format(self.continuation_prompt, line)
                transcript += command
                # create a new string buffer and set it to stdout to catch the output
                # of the command
                membuf = io.StringIO()
                self.stdout = membuf
                # then run the command and let the output go into our buffer
                self.onecmd_plus_hooks(history_item)
                # rewind the buffer to the beginning
                membuf.seek(0)
                # get the output out of the buffer
                output = membuf.read()
                # and add the regex-escaped output to the transcript
                transcript += output.replace('/', r'\/')
        finally:
            with self.sigint_protection:
                # Restore altered attributes to their original state
                self.echo = saved_echo
                self.stdout = saved_stdout

        # finally, we can write the transcript out to the file
        try:
            with open(transcript_file, 'w') as fout:
                fout.write(transcript)
        except OSError as ex:
            self.perror('Failed to save transcript: {}'.format(ex), traceback_war=False)
        else:
            # and let the user know what we did
            if len(history) > 1:
                plural = 'commands and their outputs'
            else:
                plural = 'command and its output'
            msg = '{} {} saved to transcript file {!r}'
            self.pfeedback(msg.format(len(history), plural, transcript_file))
933696
def send_cmds(self, *cmds):
        
        promise = aplus.Promise()
        tagged_cmds = list(self._tag_cmds(*cmds))
        logger.debug("Sending cmds: %s", tagged_cmds)

        cmd_group = _get_cmds_id(*tagged_cmds)
        self._cmd_groups[cmd_group] = (tagged_cmds, promise)
        self.send(json.dumps(tagged_cmds))
        return promise
336608
def add_command(self, command):
        
        try:
            self._history.remove(command)
        except ValueError:
            pass
        self._history.insert(0, command)
        self._index = -1
1136111
function commands(req, res /*, next */) {
  req.app.commands.forEach(function(command) {
    res.writeln(command);
  });
  res.end();
}