Skip to content

llama.cpp-tools: Introduce bash completion

Introduces bash completion for the tools provided by the llama.cpp-tools and llama.cpp-tools-extra packages.

Notes:

  • llama-cli can generate a bash completion file (using the --completion-bash option) and the approach taken here is to soft link this single file for all executables, even though not all options will apply to all tools (similar to how the various LVM tools link to a single completion file).
  • Using .bash-completion does not work (maybe because of the -arch / -indep mechanism?), so the completion files are installed explicitly via the .install files.
  • The completion files could be created in a lower level directory (similar to how the man files are generated), but without using *.bash-completion this makes the *.install files more complicated, so they are created directly at their target location, and those non-distributed are excluded in the not-installed file.
  • llama-cli is called after the install phase. Maybe it would be more consistent to call it after the build phase (similar to how help2man is used), but it is slightly less straightforward to find the llama-cli executable in the obj-* directory.
  • llama-quantize has completely different arguments, so the completion file is not provided for it, as it would be misleading.

In the end bash completion is working properly, but it would be a bit cleaner with the *.bash-completion mechanism. I am not sure whether it is worth investigating? Same for running the generation along with help2man?

Merge request reports

Loading