Man page - dh_shell_completions(1)

Packages contains this manual

Manual

DH_SHELL_COMPLETIONS

NAME
SYNOPSIS
DESCRIPTION
MODES
Generation
Composite
Separate
SEE ALSO
AUTHOR

NAME

dh_shell_completions - install shell completions for package

SYNOPSIS

dh_shell_completions [ debhelper options ]

DESCRIPTION

dh_shell_completions is a debhelper addon for installing completion scripts for multiple shells, respecting conventions of each shell.

It currently supports bash , fish , and zsh .

To use it, Build-Depends on it, and pass --with shell_completions to debhelper.

There are several modes of action, listed in MODES . The first has highest precedence, the last lowest.

For all modes, mentioned files can have comment lines, starting with ‘#‘.

$package in file names, if omitted, will be the first binary package defined in debian/control.

MODES

Generation

If a file named debian/[$package.]shell-completions exists, and its first non-comment line is:

mode=gen

Then the remaining lines should be one or more stanzas, each in the format:

command=command-to-generate --completions _SHELL_ [--write-to _PATH_]
shells=bash,fish,zsh
name=foo
command

command to generate a completion script. Assumed to print to stdout unless it contains the _PATH_ placeholder.

_SHELL_ is a placeholder for each shell in shells .

_PATH_ is an optional placeholder for the path to write the completion script to, if the command works that way.

shells

a comma separated list of supported shell names to generate for.

name

an optional line to specify the name of generated completions other than $package .

command will be run for each _SHELL_ specified in shells , and installs the resulting completions with specified name .

Composite

If a file named debian/[$package.]shell-completions exists, and is in the format:

$shell completions/foo # installed as foo
$shell completions/bar baz # installed as baz

then for each line, the referenced file will be installed as a completion script for $shell , named as the comments suggest.

Separate

If a file named debian/[$package.]$shell-completions exists for a supported $shell , then one of two actions are taken, depending on its content.

If it’s of the following format:

completions/foo # installed as foo
completions/bar baz # installed as baz

then the referenced file(s) will be installed as completion(s) for $shell , named as the comments above suggest.

Otherwise, it’s taken as a full completion script, and installed for $shell , named $package . This is in line with dh_bash-completion.

SEE ALSO

debhelper (1)

AUTHOR

Blair Noctis <ncts@debian.org>