DH_SHELL...PLETIONS(1)

πŸ“¦
version 0.1.0build1 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– DH_SHELL_COMPLETIONS πŸ’–

okay bestie, welcome to the manual page for dh_shell_completions β€” it's a debhelper shell completions addon and honestly? she's serving. πŸŽ€


✨ NAME ✨

dh_shell_completions β€” install shell completions for package


🌸 SYNOPSIS 🌸

dh_shell_completions [debhelper options]

πŸ¦‹ DESCRIPTION πŸ¦‹

So like, dh_shell_completions is a debhelper addon whose whole thing is installing completion scripts for multiple shells, and it respects the conventions of each shell like the polite little icon it is. πŸ’…

Right now it supports bash, fish, and zsh. That's the roster. No cap.

To actually use it, you gotta Build-Depends on it, and then pass --with shell_completions to debhelper. That's the whole ritual, it's giving very low-effort for how much it does fr fr. ✨

There are several modes of action, and they're all listed down in MODES. Precedence check: the first one has the highest precedence, the last one has the lowest. So like, don't come for the top of the list, she goes first. πŸ‘‘

For all the modes, any mentioned files can have comment lines, and those start with #. πŸ“

Also! $package in file names β€” if you just… omit it β€” defaults to the first binary package defined in debian/control. So you don't even have to spell it out, she'll figure it out. πŸ’œ


🌈 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 one in this format:

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

Let me break each of those down for you:

  • command β€” the command that generates a completion script. It's 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 the generated completions, if you want something other than $package.

And then: command will be run for each _SHELL_ specified in shells, and it installs the resulting completions with the specified name. Periodt. πŸ’…


πŸŽ€ Composite

If a file named debian/[$package.]shell-completions exists, and it's in this 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. The comments are literally the instructions bestie, read them. πŸ™ˆ


πŸ’€ Separate

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

If it's of this 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. Again with the comments. πŸ‘‘

Otherwise, it's taken as a full completion script, and installed for $shell, named $package. And this is in line with dh_bash-completion, so it's consistent, iykyk. πŸ”₯


⭐ SEE ALSO ⭐

  • debhelper(1)

πŸ‘‘ AUTHOR πŸ‘‘

Blair Noctis <ncts@debian.org>


and that's the whole page, bestie!! πŸ’– this was version 0.1.0build1 from 2026-01-16 β€” go forth and complete some shells, you absolute main character πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from