Skip to content

bash-completion: Support CMakePresets in CMake and CTest completion

Robin Lindén requested to merge robinlinden/cmake:preset-bash-completion into master

I tried to follow the style of the code in the file, but suggestions are very welcome. I haven't written any bash completions before, but this seems to work.

robin@x:~/code/CMake$ ctest --list-presets
Available test presets:

  "default"
  "with space"
  "third-preset"
robin@x:~/code/CMake$ ctest ctest --preset <TAB><TAB>
default       third-preset  with\ space
robin@x:~/code/CMake$ cmake --list-presets
Available configure presets:

  "default"              - Default Config
  "ninja-multi"          - Ninja Multi-Config
  "ninja but with space" - Ninja Multi-Config
robin@x:~/code/CMake$ cmake --preset ninja<TAB><TAB>
ninja-multi              ninja\ but\ with\ space

Merge request reports