command: 'none' category: 'meta' short: 'No completion, but specify that an argument is required' long: | Disables autocompletion for an option but still marks it as requiring an argument. Without specifying `complete`, the option would not take an argument. definition: | prog: 'example' options: - option_strings: ['--none'] complete: ['none'] output: | ~ > example --none= --- command: 'prefix' category: 'meta' synopsis: | ['prefix', , ] short: 'Prefix completions with a string' long: | `PREFIX`: The string to prepend to each completion candidate. `COMPLETER`: The completer used to generate the completion candidates. definition: | prog: 'example' options: - option_strings: ['--prefix'] complete: ['prefix', 'input:', ['file']] output: | ~ > example --prefix= ~ > example --prefix=input: ~ > example --prefix=input: ~ > example --prefix=input:file1.txt --- command: 'combine' synopsis: | ['combine', ] category: 'meta' short: 'Combine multiple completers' long: | Combines multiple completers into a single completer. `COMPLETERS`: A list of completers to combine. definition: | prog: 'example' options: - option_strings: ['--combine'] complete: ['combine', [['user'], ['pid']]] output: | ~ > example --combine=avahi,daemon, 1439404 3488332 3571716 3607235 4134206 alpm avahi bin braph daemon root rtkit systemd-coredump systemd-journal-remote systemd-network [...] --- command: 'list' short: 'Complete comma-separated lists using a completer' synopsis: | ['list', ] ['list', , ] category: 'meta' long: | `COMPLETER`: The completer used to generate the list elements. `OPTIONS`: A dictionary containing additional options for configuring the list completion. - `separator`: The separator used between list elements. Defaults to `,` - `duplicates`: Allow duplicate values to be offered for completion. Defaults to `false` also: value_list: 'For completing comma-separated lists of values' file_list: 'For completing comma-separated lists of files' directory_list: 'For completing comma-separated lists of directories' key_value_list: 'For completing comma-separated lists of key=value pairs' definition: | prog: 'example' options: - option_strings: ['--user-list'] complete: ['list', ['user']] - option_strings: ['--option-list'] complete: ['list', ['choices', ['setuid', 'async', 'block']], {'separator': ':', 'duplicates': true}] output: | ~ > example --user-list=avahi,daemon, bin braph colord dbus dhcpcd git [...] ~ > example --option-list=setuid: setuid async block --- command: 'key_value_list' category: 'meta' synopsis: | ['key_value_list', , , ] ['key_value_list', , , , ] short: 'Complete comma-separated lists of key=value pairs' long: | `PAIR_SEPARATOR`: The separator used to separate individual key-value pairs. `VALUE_SEPARATOR`: The separator used to separate a key from its value. `DEFINITIONS`: A list of key definitions. Each definition has one of the following forms: `[, , ]` -- OR -- `[, , , ]` `KEY`: The name of the key. Prefix the name with `*` to allow the key to be completed multiple times. `DESCRIPTION`: A description shown during completion. Use `null` to omit the description. `COMPLETER`: The completer used for the value of the key. Use `null` if the key does not take an argument. Use `['none']` if the key takes an argument but cannot be completed. `EXCLUDES`: A list of keys that should no longer be offered for completion once this key has been used. `CONDITION_FUNCTION`: A command or function that determines whether a key should be offered for completion. It is invoked with the key as its first argument. If it exits with status `0`, the key is offered for completion. Any non-zero exit status suppresses the key. By default, each key is offered for completion only once. To allow a key to be completed multiple times, prefix its name with `*`. also: list: 'For completing comma-separated lists using a completer' value_list: 'For completing comma-separated lists of values' key_value_pair: 'For completing single key=value pairs' key_value_list_exec: 'For completing comma-separated lists of key=value pairs (dynamically generated by a function)' definition: | prog: 'example' options: - option_strings: ['--key-value-list'] complete: ['key_value_list', ',', '=', [ ['flag', 'An option flag', null], ['nodesc', null, null], ['nocomp', 'An option with arg but without completer', ['none']], ['user', 'Takes a username', ['user']], ['*repeatable', 'This option is repeatable', null], ['exclusive', 'This option disables other options', null, ['flag', 'nodesc', 'nocomp']], ['check', 'Specify file name conversions', ['choices', { 'relaxed': 'convert to lowercase before lookup', 'strict': 'no conversion' }]] ]] output: | ~ > example --key-value-list flag,user= bin braph colord dbus dhcpcd git [...] --- command: 'key_value_pair' category: 'meta' synopsis: | ['key_value_pair', , ] ['key_value_pair', , , ] short: 'Complete single key=value pairs' long: | `VALUE_SEPARATOR`: The separator used to separate a key from its value. `DEFINITIONS`: A list of key definitions. Each definition has the following form: `[, , ]` `KEY`: The name of the key. Prefix the name with `*` to allow the key to be completed multiple times. `DESCRIPTION`: A description shown during completion. Use `null` to omit the description. `COMPLETER`: The completer used for the value of the key. Use `null` if the key does not take an argument. Use `['none']` if the key takes an argument but cannot be completed. `CONDITION_FUNCTION`: A command or function that determines whether a key should be offered for completion. It is invoked with the key as its first argument. If it exits with status `0`, the key is offered for completion. Any non-zero exit status suppresses the key. also: key_value_list: 'For completing comma-separated lists of key=value pairs' key_value_pair_exec: 'For completing single key=value pairs (dynamically generated by a function)' definition: | prog: 'example' options: - option_strings: ['--key-value-pair'] complete: ['key_value_pair', '=', [ ['flag', 'An option flag', null], ['nodesc', null, null], ['nocomp', 'An option with arg but without completer', ['none']], ['user', 'Takes a username', ['user']], ['check', 'Specify file name conversions', ['choices', { 'relaxed': 'convert to lowercase before lookup', 'strict': 'no conversion' }]] ]] output: | ~ > example --key-value-pair check -- Specify file name conversions flag -- An option flag nocomp -- An option with arg but without completer user -- Takes a username nodesc ~ > example --key-value-pair user= bin braph colord dbus dhcpcd git [...] --- command: 'integer' category: 'basic' synopsis: | ['integer'] ['integer', ] short: 'Complete integer values' long: | `OPTIONS`: A dictionary containing additional options for configuring the completion. - `min`: The minimum allowed value. - `max`: The maximum allowed value. - `suffixes`: A dictionary of suffixes and their descriptions. The suffix is appended to the completed value. - `help`: The help text shown during completion. If not specified, the `help` attribute of the option is used. also: float: 'For completing floating-point values' range: 'For completing sequences of integers' definition: | prog: 'example' options: - option_strings: ['--time'] complete: ['integer', {'suffixes': {'s': 'seconds', 'm': 'minutes', 'h': 'hours'}}] output: | ~ > example --integer=3 s -- seconds m -- minutes h -- hours --- command: 'float' category: 'basic' synopsis: | ['float'] ['float', ] short: 'Complete floating-point values' long: | `OPTIONS`: A dictionary containing additional options for configuring the completion. - `min`: The minimum allowed value. - `max`: The maximum allowed value. - `suffixes`: A dictionary of suffixes and their descriptions. The suffix is appended to the completed value. - `help`: The help text shown during completion. If not specified, the `help` attribute of the option is used. also: integer: 'For completing integer values' definition: | prog: 'example' options: - option_strings: ['--time'] complete: ['float', {'suffixes': {'s': 'seconds', 'm': 'minutes', 'h': 'hours'}}] output: | ~ > example --time=3.0 s -- seconds m -- minutes h -- hours --- command: 'file' category: 'basic' synopsis: | ['file'] ['file', ] short: 'Complete file names' long: | `OPTIONS`: A dictionary containing additional options for configuring the completion. - `directory`: Restrict completion to files inside the specified directory. - `extensions`: A list of file extensions to offer for completion. - `fuzzy`: Enable fuzzy extension matching. By default, files must end with one of the specified extensions. With fuzzy matching enabled, files with additional suffixes are also matched, for example `foo.txt.1`. - `ignore_globs`: A list of Bash globs for files that should not be offered for completion. **NOTE:** Restricting completion to specific file extensions only makes sense if the program being completed actually expects files of those types. On Unix-like systems, file extensions generally have no inherent meaning and are only conventions. also: file_list: 'For completing comma-separated lists of files' mime_file: 'For completing files by MIME type' definition: | prog: 'example' options: - option_strings: ['--file'] complete: ['file'] - option_strings: ['--file-tmp'] complete: ['file', {'directory': '/tmp'}] - option_strings: ['--file-ext'] complete: ['file', {'extensions': ['c', 'cpp']}] - option_strings: ['--file-ignore'] complete: ['file', {'ignore_globs': ['*.[tT][xX][tT]', '*.c++']}] output: | ~ > example --file= dir1/ dir2/ file1 file2 ~ > example --file-ext= dir1/ dir2/ file.c file.cpp --- command: 'directory' category: 'basic' synopsis: | ['directory'] ['directory', ] short: 'Complete directory names' long: | `OPTIONS`: A dictionary containing additional options for configuring the completion. - `directory`: Restrict completion to directories inside the specified directory. also: directory_list: 'For completing comma-separated lists of directories' definition: | prog: 'example' options: - option_strings: ['--directory'] complete: ['directory'] - option_strings: ['--directory-tmp'] complete: ['directory', {'directory': '/tmp'}] output: | ~ > example --directory= dir1/ dir2/ --- command: 'file_list' category: 'basic' synopsis: | ['file_list'] ['file_list', ] short: 'Complete comma-separated lists of files' long: | This is an alias for `['list', ['file']]`. `OPTIONS`: A dictionary containing additional options for configuring the completion. - `directory`: Restrict completion to files inside the specified directory. - `extensions`: A list of file extensions to offer for completion. - `fuzzy`: Enable fuzzy extension matching. By default, files must end with one of the specified extensions. With fuzzy matching enabled, files with additional suffixes are also matched, for example `foo.txt.1`. - `ignore_globs`: A list of Bash globs for files that should not be offered for completion. - `duplicates`: Allow duplicate values to be offered for completion. Defaults to `false`. - `separator`: The separator used between list elements. Defaults to `,`. also: list: 'For completing comma-separted lists using a completer' file: 'For completing file names' directory_list: 'For completing comma-separated lists of directories' definition: | prog: 'example' options: - option_strings: ['--file-list'] complete: ['file_list'] output: | ~ > example --file-list=file1,file2, file3 file4 --- command: 'directory_list' category: 'basic' synopsis: | ['directory_list'] ['directory_list', ] short: 'Complete comma-separated lists of directories' long: | This is an alias for `['list', ['directory']]`. `OPTIONS`: A dictionary containing additional options for configuring the completion. - `directory`: Restrict completion to directories inside the specified directory. - `duplicates`: Allow duplicate values to be offered for completion. Defaults to `false`. - `separator`: The separator used between list elements. Defaults to `,`. also: list: 'For completion comma-separated lists using a completer' directory: 'For completing directory names' file_list: 'For completing comma-separated lists of files' definition: | prog: 'example' options: - option_strings: ['--directory-list'] complete: ['directory_list'] output: | ~ > example --directory-list=directory1,directory2, directory3 directory4 --- command: 'mime_file' category: 'basic' synopsis: | ['mime_file', ] short: 'Complete files by MIME type' long: | `MIME_REGEX`: An extended regular expression used to match MIME types. The expression is passed to `grep -E` to filter the results. definition: | prog: 'example' options: - option_strings: ['--image'] complete: ['mime_file', 'image/'] output: | ~ > example --image= dir1/ dir2/ img.png img.jpg --- command: 'choices' category: 'basic' synopsis: | ['choices', ] short: 'Complete from a predefined set of values' long: | `ITEMS`: A list or dictionary containing the values to offer for completion. If a list is supplied, all items are offered without descriptions. If a dictionary is supplied, the keys are used as completion values and the values are used as descriptions. notes: - 'If the completion suggestions should appear in their original order, set `nosort` to `true`' definition: | prog: 'example' options: - option_strings: ['--choices-1'] complete: ['choices', ['Item 1', 'Item 2']] - option_strings: ['--choices-2'] complete: ['choices', {'Item 1': 'Description 1', 'Item 2': 'Description 2'}] - option_strings: ['--choices-keep-order'] complete: ['choices', ['zebra', 'cat', 'monkey']] nosort: true output: | ~ > example --choices-2= Item 1 (Description 1) Item 2 (Description 2) ~ > example --choices-keep-order= zebra cat monkey --- command: 'value_list' category: 'basic' synopsis: | ['value_list', ] short: 'Complete comma-separated lists of values' long: | `OPTIONS`: A dictionary containing additional options for configuring the completion. - `values`: A list or dictionary containing the values to offer for completion. If a list is supplied, all values are offered without descriptions. If a dictionary is supplied, the keys are used as completion values and the values are used as descriptions. - `separator`: The separator used between list elements. Defaults to `,`. - `duplicates`: Allow duplicate values to be offered for completion. Defaults to `false`. also: list: 'For completing comma-separated lists using a completer' key_value_list: 'For completing comma-separated lists of key=value pairs' definition: | prog: 'example' options: - option_strings: ['--value-list-1'] complete: ['value_list', {'values': ['exec', 'noexec']}] - option_strings: ['--value-list-2'] complete: ['value_list', {'values': {'one': 'Description 1', 'two': 'Description 2'}}] output: | ~ > example --value-list-1= exec noexec ~ > example --value-list-1=exec, noexec ~ > example --value-list-2= one -- Description 1 two -- Description 2 --- command: 'exec' category: 'custom' synopsis: | ['exec', ] short: 'Complete values from the output of a command or function' long: | `COMMAND`: The command or function to execute. Its output must be formatted as tab-separated values: ``` \t \t [...] ``` Each line represents one completion candidate. The item and its description are separated by a tab character. also: exec_fast: 'Faster implementation of exec' exec_internal: "Use the shell's internal completion mechanisms" notes: - 'Functions can be put inside a file and included with `--include-file`' definition: | prog: 'example' options: - option_strings: ['--exec'] complete: ['exec', "printf '%s\\t%s\\n' 'Item 1' 'Description 1' 'Item 2' 'Description 2'"] output: | ~ > example --exec= Item 1 (Description 1) Item 2 (Description 2) --- command: 'exec_fast' category: 'custom' synopsis: | ['exec_fast', ] short: 'Complete values from the output of a command or function (fast and unsafe)' long: | Faster version of `exec` for handling large amounts of data. Unlike `exec`, this implementation does not safely handle arbitrary output. Completion items must not contain whitespace or special shell characters. notes: - 'Functions can be put inside a file and included with `--include-file`' definition: | prog: 'example' options: - option_strings: ['--exec-fast'] complete: ['exec_fast', "printf '%s\\t%s\\n' 1 one 2 two"] output: | ~ > example --exec-fast= 1 -- one 2 -- one --- command: 'exec_internal' category: 'custom' synopsis: | ['exec_internal', ] short: "Use the shell's internal completion mechanisms" long: | Execute a function that internally modifies the completion state. This is useful if a more advanced completion is needed. For **Bash**, it might look like: ```sh my_completion_func() { COMPREPLY=( $(compgen -W 'read write append' -- '$cur') ) } ``` For **Zsh**, it might look like: ```sh my_completion_func() { local items=( read:'Read data from a file' write:'Write data from a file' append:'Append data to a file' ) _describe 'my items' items } ``` For **Fish**, it might look like: ```sh function my_completion_func printf '%s\t%s\n' \ read 'Read data from a file' \ write 'Write data from a file' \ append 'Append data to a file' end ``` notes: - 'Functions can be put inside a file and included with `--include-file`' definition: | prog: 'example' options: - option_strings: ['--exec-internal'] complete: ['exec_internal', 'my_completion_func'] output: | ~ > example --exec-internal= append -- Append data to a file read -- Read data from a file write -- Write data from a file --- command: 'key_value_pair_exec' category: 'custom' synopsis: | ['key_value_pair_exec', , ] short: 'Complete dynamically generated a key=value pairs' long: | `VALUE_SEPARATOR`: The separator used to separate a key from its value. `COMMAND`: The command or function used to generate the available keys and values. If invoked without arguments, it must output the available keys in the following format: ``` [=]\t [=]\t [...] ``` Appending `=` to a key indicates that it requires a value. If invoked with a single argument, the argument is the selected key. The command must output the possible values for that key in the following format: ``` \t \t [...] ``` Each line represents one completion candidate. The item and its description are separated by a tab character. Example function: ```sh _complete_key_value_pair() { if (( $# == 0 )); then printf '%s\t%s\n' \ 'flag' 'a flag' \ 'option=' 'option with value' else case '$1' in option) printf '%s\t%s\n' \ 'foo' 'a foo value' \ 'bar' 'a bar value';; esac fi } ``` also: key_value_pair: 'For completing single key=value pairs' notes: - 'Functions can be put inside a file and included with `--include-file`' definition: | prog: 'example' options: - option_strings: ['-o'] complete: ['key_value_pair_exec', '=', '_complete_key_value_pair'] output: | ~ > example -o flag -- a flag option -- option with value ~ > example -o option= foo -- a foo value bar -- a bar value --- command: 'key_value_list_exec' category: 'custom' synopsis: | ['key_value_list_exec', , , ] short: 'Complete dynamically generated comma-separted lists of key=value pairs' long: | `PAIR_SEPARATOR`: The separator used to separate individual key-value pairs. `VALUE_SEPARATOR`: The separator used to separate a key from its value. `COMMAND`: The command or function used to generate the available keys and values. If invoked without arguments, it must output the available keys in the following format: ``` [*][=][?]\t\t [*][=][?]\t\t [...] ``` Prefixing a key with `*` marks it as repeatable. Appending `=` to a key indicates that it requires a value. Appending `=?` to a key indicates that it requires an optional value. `EXCLUDES` is a space-separated list of keys that should no longer be offered once the current key has been used. If invoked with a single argument, the argument is the selected key. The command must output the possible values for that key in the following format: ``` \t \t [...] ``` Each line represents one completion candidate. The item and its description are separated by a tab character. Example function: ```sh _complete_key_value_list() { if (( $# == 0 )); then printf '%s\t%s\t%s\n' \ 'flag' 'option without an argument' '' \ 'argument=' 'option with an argument' '' \ 'optional=?' 'option with an optional argument' '' \ '*repeatable' 'a repeatable option' '' \ 'excludes' 'disable options' 'flag argument' else case '$1' in argument|optional) printf '%s\t%s\n' \ 'foo' 'a foo value' \ 'bar' 'a bar value';; esac fi } ``` also: key_value_list: 'For completing comma-separated lists of key=value pairs' notes: - 'Functions can be put inside a file and included with `--include-file`' definition: | prog: 'example' options: - option_strings: ['-o'] complete: ['key_value_list_exec', ',', '=', '_complete_key_value_list'] output: | ~ > example -o argument -- option with an argument excludes -- disable options flag -- option without an argument optional -- option with an optional argument repeatable -- a repeatable option ~ > example -o argument= foo -- a foo value bar -- a bar value ~ > example -o excludes, optional -- option with an optional argument repeatable -- a repeatable option --- command: 'range' category: 'basic' synopsis: | ['range', , ] ['range', , , ] short: 'Complete sequences of integers' long: | `START`: The first value of the range. `STOP`: The last value of the range. `STEP`: The increment between values. Defaults to `1`. definition: | prog: 'example' options: - option_strings: ['--range-1'] complete: ['range', 1, 9] - option_strings: ['--range-2'] complete: ['range', 1, 9, 2] output: | ~ > example --range-1= 1 2 3 4 5 6 7 8 9 ~ > example --range-2= 1 3 5 7 9 --- command: 'signal' category: 'basic' short: 'Complete signal names' definition: | prog: 'example' options: - option_strings: ['--signal'] complete: ['signal'] output: | ~ > example --signal= ABRT -- Process abort signal ALRM -- Alarm clock BUS -- Access to an undefined portion of a memory object CHLD -- Child process terminated, stopped, or continued CONT -- Continue executing, if stopped FPE -- Erroneous arithmetic operation HUP -- Hangup ILL -- Illegal instruction INT -- Terminal interrupt signal [...] --- command: 'hostname' category: 'basic' short: 'Complete hostnames' also: ip_address: 'For completing local IP addresses' definition: | prog: 'example' options: - option_strings: ['--hostname'] complete: ['hostname'] output: | ~ > example --hostname= localhost --- command: 'process' category: 'basic' short: 'Complete process names' also: pid: 'For completing process IDs' definition: | prog: 'example' options: - option_strings: ['--process'] complete: ['process'] output: | ~ > example --process=s scsi_eh_0 scsi_eh_1 scsi_eh_2 scsi_eh_3 scsi_eh_4 scsi_eh_5 sh sudo syndaemon systemd systemd-journald systemd-logind systemd-udevd --- command: 'pid' category: 'basic' short: 'Complete process IDs' also: process: 'For completing process names' definition: | prog: 'example' options: - option_strings: ['--pid'] complete: ['pid'] output: | ~ > example --pid= 1 13 166 19 254 31 45 1006 133315 166441 19042 26 32 46 10150 1392 166442 195962 27 33 4609 --- command: 'filesystem_type' category: 'basic' short: 'Complete filesystem types' definition: | prog: 'example' options: - option_strings: ['--filesystem-type'] complete: ['filesystem_type'] output: | ~ > example --filesystem-type= adfs autofs bdev bfs binder binfmt_misc bpf cgroup cgroup2 configfs cramfs debugfs devpts devtmpfs [...] --- command: 'command' category: 'basic' synopsis: | ['command'] ['command', ] short: 'Complete command names' long: | This completer provides completion suggestions for executable commands available in the system's `$PATH`. `OPTIONS`: A dictionary containing additional options for configuring the completion. - `path`: Override the default `$PATH` used for searching executables. - `path_append`: Append directories to the default `$PATH`. - `path_prepend`: Prepend directories to the default `$PATH`. notes: - '`path_append` and `path_prepend` can be used together, but both are mutually exclusive with `path`.' also: command_arg: 'For completing arguments of a command' commandline_string: 'For completing command lines as strings' definition: | prog: 'example' options: - option_strings: ['--command'] complete: ['command'] - option_strings: ['--command-sbin'] complete: ['command', {'path_append': '/sbin:/usr/sbin'}] output: | ~ > example --command=bas base32 base64 basename basenc bash bashbug --- command: 'command_arg' category: 'basic' short: 'Complete command arguments' notes: - 'This completer can only be used in combination with a previously defined `command` completer.' - 'This completer requires `repeatable: true`.' also: command: 'For completing command names' commandline_string: 'For completing command lines as strings' definition: | prog: 'example' positionals: - number: 1 complete: ['command'] - number: 2 complete: ['command_arg'] repeatable: true output: | ~ > example sudo bas base32 base64 basename basenc bash bashbug --- command: 'commandline_string' category: 'basic' short: 'Complete command lines as strings' also: command: 'For completing command names' command_arg: 'For completing command arguments' definition: | prog: 'example' options: - option_strings: ['--commandline'] complete: ['commandline_string'] output: | ~ > example --commandline='sudo ba base32 base64 basename basenc bash bashbug --- command: 'user' category: 'basic' short: 'Complete user names' also: uid: 'For completing user IDs' definition: | prog: 'example' options: - option_strings: ['--user'] complete: ['user'] output: | ~ > example --user= avahi bin braph colord daemon dbus dhcpcd ftp git [...] --- command: 'group' category: 'basic' short: 'Complete group names' also: gid: 'For completing group IDs' definition: | prog: 'example' options: - option_strings: ['--group'] complete: ['group'] output: | ~ > example --group= adm audio avahi bin braph colord daemon dbus dhcpcd disk floppy ftp games git groups [...] --- command: 'uid' category: 'basic' short: 'Complete user IDs' also: user: 'For completing user names' definition: | prog: 'example' options: - option_strings: ['--uid'] complete: ['uid'] output: | ~ > example --uid= 0 -- root 1000 -- braph 102 -- polkitd 133 -- rtkit 14 -- ftp 1 -- bin 2 -- daemon 33 -- http 65534 -- nobody [...] --- command: 'gid' category: 'basic' short: 'Complete group IDs' also: group: 'For completing group names' definition: | prog: 'example' options: - option_strings: ['--gid'] complete: ['gid'] output: | ~ > example --gid= 0 -- root 1000 -- braph 102 -- polkitd 108 -- vboxusers 11 -- ftp 12 -- mail 133 -- rtkit 19 -- log [...] --- command: 'service' category: 'basic' short: 'Complete systemd service names' definition: | prog: 'example' options: - option_strings: ['--service'] complete: ['service'] output: | ~ > example --service= TODO [...] --- command: 'variable' category: 'basic' short: 'Complete shell variable names' also: environment: 'For completing environment variable names' definition: | prog: 'example' options: - option_strings: ['--variable'] complete: ['variable'] output: | ~ > example --variable=HO HOME HOSTNAME HOSTTYPE --- command: 'environment' category: 'basic' short: 'Complete environment variable names' also: variable: 'For completing shell variable names' definition: | prog: 'example' options: - option_strings: ['--environment'] complete: ['environment'] output: | ~ > example --environment=X XDG_RUNTIME_DIR XDG_SEAT XDG_SESSION_CLASS XDG_SESSION_ID XDG_SESSION_TYPE XDG_VTNR --- command: 'history' category: 'basic' synopsis: | ['history', ] short: "Complete based on a shell's history" long: | `REGEX`: An extended regular expression used to filter history entries. The regular expression is passed to `grep -E`. definition: | prog: 'example' options: - option_strings: ['--history'] complete: ['history', '[a-zA-Z0-9]+@[a-zA-Z0-9]+'] output: | ~ > example --history= foo@bar mymail@myprovider --- command: 'date' category: 'basic' synopsis: | ['date', ] short: 'Complete date strings' long: | `FORMAT`: The date format as described in `strftime(3)`. also: date_format: 'For completing date format strings' implemented: ['Zsh'] definition: | prog: 'example' options: - option_strings: ['--date'] complete: ['date', '%Y-%m-%d'] output: | ~ > example --date= November Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 --- command: 'date_format' category: 'basic' short: 'Complete date format strings' also: date: 'For completing dates' implemented: ['Fish', 'Zsh'] definition: | prog: 'example' options: - option_strings: ['--date-format'] complete: ['date_format'] output: | ~ > example --date-format '% a -- abbreviated day name A -- full day name B -- full month name c -- preferred locale date and time C -- 2-digit century d -- day of month (01-31) D -- American format month/day/year (%m/%d/%y) e -- day of month ( 1-31) [...] --- command: 'ip_address' category: 'basic' synopsis: | ['ip_address', ] short: 'Complete local IP addresses' long: | `TYPE`: The type of ip addresses to complete: - `ipv4`: IPv4 addresses - `ipv6`: IPv6 addresses - `all`: Both IPv4 and IPv6 addresses Append `+` to include the unspecified address of the selected family: - `ipv4+`: Includes `0.0.0.0` - `ipv6+`: Includes `::` - `all+`: Includes both 0.0.0.0 and `::` also: net_interface: 'For completing network interfaces' hostname: 'For completing hostnames' definition: | prog: 'example' options: - option_strings: ['--ip-address'] complete: ['ip_address'] - option_strings: ['--ip-address-v4'] complete: ['ip_address', 'ipv4'] - option_strings: ['--ip-address-v6'] complete: ['ip_address', 'ipv6'] output: | ~ > example --ip-address= ::1 10.0.0.71 127.0.0.1 fe80::f567:7a1a:3c98:808d ~ > example --ip-address-v4= 10.0.0.71 127.0.0.1 ~ > example --ip-address-v6= ::1 fe80::f567:7a1a:3c98:808d --- command: 'net_interface' category: 'bonus' short: 'Complete network interfaces' also: ip_address: 'For completing IP addresses' definition: | prog: 'example' options: - option_strings: ['--net-interface'] complete: ['net_interface'] output: | ~ > example --net-interface= eno1 enp1s0 lo wlo1 wlp2s0 [...] --- command: 'mountpoint' category: 'bonus' short: 'Complete mount points' definition: | prog: 'example' options: - option_strings: ['--mountpoint'] complete: ['mountpoint'] output: | ~ > example --mountpoint= / /boot /home /proc /run /sys /tmp [...] --- command: 'login_shell' category: 'bonus' short: 'Complete login shells' definition: | prog: 'example' options: - option_strings: ['--login-shell'] complete: ['login_shell'] output: | ~ > example --login-shell= /bin/bash /bin/sh /usr/bin/fish /usr/bin/sh [...] --- command: 'charset' category: 'bonus' short: 'Complete character sets' definition: | prog: 'example' options: - option_strings: ['--charset'] complete: ['charset'] output: | ~ > example --charset=A ANSI_X3.110-1983 ANSI_X3.4-1968 ARMSCII-8 ASMO_449 --- command: 'locale' category: 'bonus' short: 'Complete locales' definition: | prog: 'example' options: - option_strings: ['--locale'] complete: ['locale'] output: | ~ > example --locale= C C.UTF-8 de_DE de_DE@euro de_DE.iso88591 de_DE.iso885915@euro de_DE.UTF-8 deutsch en_US en_US.iso88591 en_US.UTF-8 german POSIX --- command: 'timezone' category: 'bonus' short: 'Complete timezones' definition: | prog: 'example' options: - option_strings: ['--timezone'] complete: ['timezone'] output: | ~ > example --timezone=Europe/B Belfast Belgrade Berlin Bratislava Brussels Bucharest Budapest Busingen --- command: 'alsa_card' category: 'bonus' short: 'Complete ALSA cards' also: alsa_device: 'For completing ALSA devices' definition: | prog: 'example' options: - option_strings: ['--alsa-card'] complete: ['alsa_card'] output: | ~ > example --alsa-card= 0 1 --- command: 'alsa_device' category: 'bonus' short: 'Complete ALSA devices' also: alsa_card: 'For completing ALSA cards' definition: | prog: 'example' options: - option_strings: ['--alsa-device'] complete: ['alsa_device'] output: | ~ > example --alsa-device= hw:0 hw:1