Project

General

Profile

Actions

Added in 4.3

$commands(N/command)

Returns the Nth built-in and/or alias command.

Parameters

Parameter Description
N If N = 0 number of commands, otherwise the Nth command.
command Returns $true if the command exists, otherwise $false.

Properties

Property Description
.builtin Only list the built-in commands.
.aliases Only list the aliases found in scripts/plugins.

Example

; Print number of total commands.
//echo -ag $commands(0)

; Print number of built-in commands.
//echo -ag $commands(0).builtin

; Print number of aliases commands found in scripts/plugins.
//echo -ag $commands(0).aliases

; Print the first commands.
//echo -ag $commands(1)

Updated by Per Amundsen almost 2 years ago · 2 revisions

Also available in: PDF HTML TXT