A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/perlpunk/shell-completions below:

perlpunk/shell-completions: Collection of shell (bash, zsh) tab completion scripts for various command line tools

Collection of shell tab completion scripts for various command line tools

These scripts are automatically generated from YAML files which can be found under specs/.

The format supports nested subcommands, specifying enums for possible parameters/option values and dynamic completion calling an external command.

The generation is done with the appspec tool (see "Developing" below).

Currently it supports bash and zsh completions.

git clone https://github.com/perlpunk/shell-completions

Look into the specs/commandname.yaml for specific usage instructions.

For a specific script, just source it:

$ source /path/to/shell-completions/bash/commandname.bash

Put this in your .bashrc for using all completions:

for i in /path/to/shell-completions/bash/*.bash; do source $i; done
Using only one <TAB> keypress like in zsh

You can enable this by putting the following in your ~/.inputrc:

set show-all-if-ambiguous on

See GNU Readline Init File Syntax.

For activating the completions, you can do:

% fpath=(/path/to/shell-completions/zsh $fpath)
% compinit

To just try out completion for one specific script, you can also do:

% source /path/to/shell-completions/zsh/_commandname
% compdef _commandname commandname

Put this in your .zshrc for activating all completions:

# before the compinit call
fpath=('/path/to/shell-completions/zsh' $fpath)

This way zsh won't load all functions at startup, but the completions will get autoloaded dynamically when the command is first used.

When developing a new completion, after a change it's enough to source it, without calling compinit again:

% source /path/to/shell-completions/zsh/_commandname

The appspec tool is used to generate the completions. You don't need it if you just want to use the completions.

If you want to modify or add a new completion, install the App::AppSpec perl module, or use the standalone script:

% git clone https://github.com/perlpunk/App-AppSpec-p5 -b standalone appspec
% PATH=$PWD/appspec/bin:$PATH

For more details see https://github.com/perlpunk/App-AppSpec-p5.

Create a new specification specs/commandname.yaml and type:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4