dh_bash-completion
Install bash completion files for Debian packages
SYNOPSIS
dh_bash-completion [debhelper options]
PARAMETERS
--no-act
Do not actually do anything; just print the commands that would be run.
-v, --verbose
Show more verbose output, explaining what is being done.
-ppackage, --package=package
Act only on the specified package.
-a, --arch
Act only on architecture-dependent packages.
-i, --indep
Act only on architecture-independent packages.
Other debhelper options
Like most dh_ commands, dh_bash-completion accepts generic debhelper options documented in debhelper(7).
DESCRIPTION
dh_bash-completion is a debhelper program that is responsible for installing bash completion scripts into the correct system-wide locations for Debian packages. It typically runs during the dh build sequence, often implicitly via dh --with bash-completion or when debhelper detects relevant files. It looks for completion files either provided by the package maintainer in the debian/ directory (e.g., debian/<packagename>.bash-completion) or generated by other debhelper tools. It then places them into usr/share/bash-completion/completions/ or etc/bash_completion.d/ within the package's build tree (debian/<packagename>/), ensuring they are properly packaged and installed on the user's system. This automation simplifies package maintenance and allows users to benefit from tab completion for commands provided by the package.
CAVEATS
1. dh_bash-completion is rarely invoked directly by package maintainers.
It is almost always part of the automated dh sequence in debian/rules (dh or dh --with bash-completion).
2. The completion scripts themselves must be correctly formatted and placed in the appropriate locations within the debian/ directory for debhelper to find them.
3. For the completion to function, the bash-completion package must be installed on the end-user's system.
INSTALLATION LOCATIONS
dh_bash-completion installs completion files into the standard system locations for bash completion scripts, typically /usr/share/bash-completion/completions/ (for statically loaded completions) or /etc/bash_completion.d/ (for dynamically loaded completions) within the final package file system. It handles the packaging of these files into the appropriate debian/<packagename>/ subdirectories.
TYPICAL INVOCATION IN DEBIAN/RULES
Package maintainers usually do not call dh_bash-completion directly. Instead, they rely on dh to call it automatically.
This is typically achieved by:
1. Using dh directly (e.g., dh $@ in debian/rules), where debhelper detects the presence of completion files (e.g., debian/<packagename>.bash-completion).
2. Explicitly enabling the bash-completion sequence via dh --with bash-completion $@.
HISTORY
Part of the debhelper suite, dh_bash-completion was introduced to streamline and automate the process of packaging bash completion scripts for Debian packages. Its development reflects the ongoing effort to simplify common packaging tasks and improve the user experience by ensuring that command-line completions are easily available for software installed via Debian packages.