Display the command history
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)))
85195
def history_view(self, request, object_id, extra_context=None):
        ""
        from django.contrib.admin.models import LogEntry
        # First check if the user can see this history.
        model = self.model
        obj = get_object_or_404(self.get_queryset(request),
                                pk=unquote(object_id))
        if not self.has_change_permission(request, obj):
            raise PermissionDenied

        # Then get the history for this object.
        opts = model._meta
        app_label = opts.app_label
        action_list = LogEntry.objects.filter(
            object_id=unquote(str(obj.identity)),
            # this is the change for our override;
            content_type=get_content_type_for_model(model)
        ).select_related().order_by('action_time')
        ctx = self.admin_site.each_context(request)

        context = dict(ctx,
                       title=('Change history: %s') % force_text(obj),
                       action_list=action_list,
                       module_name=capfirst(
                           force_text(opts.verbose_name_plural)),
                       object=obj,
                       opts=opts,
                       preserved_filters=self.get_preserved_filters(request),
                       )
        context.update(extra_context or {})
        return TemplateResponse(request, self.object_history_template or [
            "admin/%s/%s/object_history.html" % (app_label, opts.model_name),
            "admin/%s/object_history.html" % app_label,
            "admin/object_history.html"
        ], context)
1199900
public function show_synopsis_if_composite_command() {
		$r = $this->find_command_to_run( $this->arguments );
		if ( is_array( $r ) ) {
			list( $command ) = $r;

			if ( $command->can_have_subcommands() ) {
				$command->show_usage();
				exit;
			}
		}
	}
11050
def previewed_data(hosts, commands)
      @commands = commands
      hosts.map do |each|
        @host_param = each
        # [for a host] operation
        ready_to_open_host_session do |spawn_cmd|
          whole_previewed_parameters(spawn_cmd)
        end
      end
    end
1322973
def history(namespace_module):
    """"""
    for path in get_namespace_history(namespace_module):
        h = get_bel_resource_hash(path.as_posix())
        click.echo('{}\t{}'.format(path, h))
1239135
protected void addToHistory (String cmd)
    {
        // remove any previous instance of this command
        _history.remove(cmd);

        // append it to the end
        _history.add(cmd);

        // prune the history once it extends beyond max size
        if (_history.size() > MAX_COMMAND_HISTORY) {
            _history.remove(0);
        }
    }
12226
def update_history(self, directory):
        """"""
        try:
            directory = osp.abspath(to_text_string(directory))
            if directory in self.history:
                self.histindex = self.history.index(directory)
        except Exception:
            user_directory = get_home_dir()
            self.chdir(directory=user_directory, browsing_history=True)
1342718
function read_cli(event){

	var which = event.which;
	var ctrl_p = event.ctrlKey;
	//log('cli: ' + which + ', ' + ctrl_p);

	if ( which == 13 ) { // return
	    
	    // Stop events.
	    event.preventDefault();
	    
	    // Get and ensure nice JS, wipe CLI clean.
	    var to_eval = jQuery('#' + command_line.get_id()).val();
	    if( to_eval != '' ){
		jQuery('#' + command_line.get_id()).val('');
		
		// Enter the new command into our history and bump the
		// index to the last thing pushed on.
		history_list.pop(); // pop the empty ''
		history_list.push(to_eval);
		history_list.push(''); // push new empty ''
		history_pointer = history_list.length -1;
		//log('// history: '+history_pointer+', '+history_list.length);
		
		// Log, eval, log.
		to_eval = bbop.core.ensure(to_eval, ';', 'back');
		log(to_eval);
		var evals = _evaluate(to_eval);
		log('// ' + evals[1]);
		_advance_log_to_bottom();

		return false;
	    }
	}else if( ctrl_p && which == 38 ){ // ctrl + up

	    // Stop stuff?
	    event.preventDefault();

	    if( history_pointer == 0 ){
		_update_cli();
	    }else if( history_pointer > 0 ){
		history_pointer--;
		_update_cli();
	    }

	    return false;

	}else if( ctrl_p && which == 40 ){ // ctrl + down

	    // Stop stuff?
	    event.preventDefault();

	    if( history_pointer < history_list.length -1 ){
		history_pointer++;
		_update_cli();
	    }

	    return false;
	}

	return true;
    }
1096390
public function showCommandList(): void
    {
        /** @var \Inhere\Console\IO\Input $input */
        $input = $this->input;
        // has option: --auto-completion
        $autoComp = $input->getBoolOpt('auto-completion');
        // has option: --shell-env
        $shellEnv = (string)$input->getLongOpt('shell-env', '');

        // php bin/app list --only-name
        if ($autoComp && $shellEnv === 'bash') {
            $this->dumpAutoCompletion($shellEnv, []);
            return;
        }

        /** @var \Inhere\Console\IO\Output $output */
        $output = $this->output;
        /** @var Router $router */
        $router = $this->getRouter();
        $script = $this->getScriptName();

        $hasGroup    = $hasCommand = false;
        $groupArr    = $commandArr = [];
        $placeholder = 'No description of the command';

        // all console groups/controllers
        if ($groups = $router->getControllers()) {
            $hasGroup = true;
            \ksort($groups);
        }

        // all independent commands, Independent, Single, Alone
        if ($commands = $router->getCommands()) {
            $hasCommand = true;
            \ksort($commands);
        }

        // add split title on both exists.
        if (!$autoComp && $hasCommand && $hasGroup) {
            $groupArr[]   = \PHP_EOL . '- <bold>Group Commands</bold>';
            $commandArr[] = \PHP_EOL . '- <bold>Alone Commands</bold>';
        }

        foreach ($groups as $name => $info) {
            $options    = $info['options'];
            $controller = $info['handler'];
            /** @var \Inhere\Console\AbstractHandler $controller */
            $desc    = $controller::getDescription() ?: $placeholder;
            $aliases = $options['aliases'];
            $extra   = $aliases ? ColorTag::wrap(
                ' [alias: ' . \implode(',', $aliases) . ']',
                'info'
            ) : '';

            // collect
            $groupArr[$name] = $desc . $extra;
        }

        if (!$hasGroup && $this->isDebug()) {
            $groupArr[] = '... Not register any group command(controller)';
        }

        foreach ($commands as $name => $info) {
            $desc    = $placeholder;
            $options = $info['options'];
            $command = $info['handler'];

            /** @var \Inhere\Console\AbstractHandler $command */
            if (\is_subclass_of($command, CommandInterface::class)) {
                $desc = $command::getDescription() ?: $placeholder;
            } elseif ($msg = $options['description'] ?? '') {
                $desc = $msg;
            } elseif (\is_string($command)) {
                $desc = 'A handler : ' . $command;
            } elseif (\is_object($command)) {
                $desc = 'A handler by ' . \get_class($command);
            }

            $aliases = $options['aliases'];
            $extra   = $aliases ? ColorTag::wrap(' [alias: ' . \implode(',', $aliases) . ']', 'info') : '';

            $commandArr[$name] = $desc . $extra;
        }

        if (!$hasCommand && $this->isDebug()) {
            $commandArr[] = '... Not register any alone command';
        }

        // built in commands
        $internalCommands = static::$internalCommands;

        if ($autoComp && $shellEnv === 'zsh') {
            $map = \array_merge($internalCommands, $groupArr, $commandArr);
            $this->dumpAutoCompletion('zsh', $map);
            return;
        }

        \ksort($internalCommands);
        Console::startBuffer();

        if ($appDesc = $this->getParam('description', '')) {
            $appVer = $this->getParam('version', '');
            Console::writeln(\sprintf('%s%s' . \PHP_EOL, $appDesc, $appVer ? " (Version: <info>$appVer</info>)" : ''));
        }

        // built in options
        $internalOptions = FormatUtil::alignOptions(self::$globalOptions);

        Show::mList([
            'Usage:'              => "$script <info>{command}</info> [--opt -v -h ...] [arg0 arg1 arg2=value2 ...]",
            'Options:'            => $internalOptions,
            'Internal Commands:'  => $internalCommands,
            'Available Commands:' => \array_merge($groupArr, $commandArr),
        ], [
            'sepChar' => '  ',
        ]);

        unset($groupArr, $commandArr, $internalCommands);
        Console::write("More command information, please use: <cyan>$script {command} -h</cyan>");
        Console::flushBuffer();
    }
890928
def history(directory, rev_range, verbose, indicate_current):
    """"""
    _history(directory, rev_range, verbose, indicate_current)
931803
def record_command(self, cmd, prg=''):
        
        self._log(self.logFileCommand , force_to_string(cmd), prg)
904243
def results_history(history_log, no_color):
    """"""
    try:
        with open(history_log, 'r') as f:
            lines = f.readlines()
    except Exception as error:
        echo_style(
            'Unable to process results history log: %s' % error,
            no_color,
            fg='red'
        )
        sys.exit(1)

    index = len(lines)
    for item in lines:
        click.echo('{} {}'.format(index, item), nl=False)
        index -= 1
1191048
public DeviceDataHistory[] command_history(final DeviceProxy deviceProxy, final String cmdname)
            throws DevFailed {
        int hist_depth = 10;
        final DbDatum data = get_property(deviceProxy, "poll_ring_depth");
        if (!data.is_empty()) {
            hist_depth = data.extractLong();
        }
        return command_history(deviceProxy, cmdname, hist_depth);
    }
1075378
def im_history(self, room_id, **kwargs):
        """"""
        return self.__call_api_get('im.history', roomId=room_id, kwargs=kwargs)
862684
def display_commands( cmdlist )
      maxlen = 0
      cmdlist.each do |cmd|
	maxlen = cmd.name.length if cmd.name.length > maxlen
      end
      cmdlist.each do |cmd|
	print '  ' + cmd.name
	print "#{' ' * (maxlen - cmd.name.length)}  # "
	puts cmd.brief
      end
    end
375100
function _loop(options, onCommand, _history) {
    _history = _history || [];

    var readOptions = _.extend({}, options, {
        'ps1': options.ps1(),
        'ps2': options.ps2(),
        'history': _history
    });

    read(readOptions, function(err, args, str) {
        // If the user entered an actual command, put the string in the command history
        if (str) {
            _history.push(str.split('\n').shift());
        }

        // Provide the args to the caller
        onCommand(err, args, str, function() {
            // Recursively ask for the next command
            return _loop(options, onCommand, _history);
        });
    });
}
1094675
public function listCommand(): void
    {
        $list = [
            'The is a list line 0',
            'The is a list line 1',
            'The is a list line 2',
            'The is a list line 3',
        ];

        Show::aList($list, 'a List show(No key)');

        $commands = [
            'version' => 'Show application version information',
            'help'    => 'Show application help information',
            'list'    => 'List all group and independent commands',
            'a only value message text'
        ];

        Show::aList($commands, 'a List show(Has key)');
    }