CMDLINER-INS...L-COMPLETION(1)
π cmdliner-install-tool-completion(1) β like, the Cmdliner Manual bestie β¨
okay so real talk, this is a page from the Cmdliner Manual and it's all about cmdliner-install-tool-completion, which is genuinely one of those commands that just works so you don't have to. let's get into it π«Ά
πΈ NAME πΈ
cmdliner-install-tool-completion β installs tool completion scripts. that's it, that's the vibe. β¨
π SYNOPSIS π
cmdliner install tool-completion [OPTION]⦠TOOLNAME⦠SHAREDIR
π¦ DESCRIPTION π¦
so cmdliner install tool-completion is the main character here: it installs the tool completion script(s) for whatever tools and shells you hand it, into a share directory, and it follows the specific conventions each shell expects. directories get created if they don't exist already β no cap, it just does it. π
want to peek before committing? use the --dry-run option and it'll show you which paths would be written. iconic. example time:
cmdliner install tool-completion mytool /usr/local/share # All supported shells
cmdliner install tool-completion --shell zsh mytool /usr/local/share
heads up bestie π β the commandinstall tool-supportalso installs completions, same as this command does. and if you want to actually inspect the scripts (not install them), use thetool-completioncommand instead. iykyk.
π ARGUMENTS π
β SHAREDIR (required)
SHAREDIR is literally just the share directory you're installing to. that's the whole job.
β TOOLNAME (required)
TOOLNAME is the name of the tool you want to complete. and yes, it's repeatable β go off, list as many as you want π
β¨ OPTIONS β¨
--dry-runβ do not install anything, just output the paths that would be written. a little preview moment, we love to see it π-s SHELL,--shell=SHELL(absent = All supported shells) β the shell you want to support. it must be one ofbash,zshorpwsh. repeatable, so you can stack 'em up π§--standalone-completionβ generates standalone completion scripts. these scripts do not depend on the generic cmdliner completion scripts. fair warning though: for some shells this may result in slower completion π (tradeoff queen)--update-opam-install=PKG.installβ updates or creates an opam.installfilePKG.install, with install moves going from the installed files to the corresponding opam install sections. and yes, this also happens if--dry-runis specified. slay π
π COMMON OPTIONS π
--help[=FMT](default =auto) β shows this help in formatFMT.FMTmust be one ofauto,pager,grofforplain. withauto, the format ispagerorplainwhenever theTERMenv var isdumbor undefined. (env var respecting behavior, we stan π)--versionβ shows version information. periodt.
π EXIT STATUS π
cmdliner install tool-completion exits with:
0β on success. we love a clean win β¨123β on indiscriminate errors reported on standard error.124β on command line parsing errors.125β on unexpected internal errors (bugs). not me filing a bug report π
π₯ SEE ALSO π₯
cmdliner(1) β go read that one too, bestie π«Ά
and that's the whole page, fr fr β no notes π
okay so final sign-off: this gem is Cmdliner v2.1.1 and it lives in the Cmdliner Manual. go forth and complete all the things πβ¨π
π¦ where this page comes from
- arch rolling: ocaml-cmdliner 2.1.1-1 Β· ISC
- nixos 26.05: cmdliner 2.1.1
- nixpkgs unstable: cmdliner 2.1.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms