CetMakeCompletions

Define the function cet_make_completions() to generate BASH completion shell code.

cet_make_completions

Generate BASH command-completion shell code for an exec with -h help text generated by Boost Program Options.

cet_make_completions(<exec-target> [<user-completions-file>])

Non-option arguments

<exec-target>

The executable target for which to generate BASH command-completion code.

<user-completions-file>

One or more files containing completions in addition to those to be generated.

Details

Completions will be written to CMAKE_CURRENT_BINARY_DIR and installed in <PROJECT-NAME>_BIN_DIR.

The automatically generated bash completions simply allow completions for any program options, irrespective of any other program options that have been provided on the command line. For more specialized behavior, one or more supplementary <user-completion-file>s can be provided as non-option argmuents following <exec-target>.

In this customizations file, the following dereferences are allowed:

${cur}

The command-line word currently being parsed

${prev}

The previous word that was parsed

as well as any of the Bash variables (e.g. COMP_WORDS, COMPREPLY, etc.).

If a customizations file is provided, all automatically generated completions are still available—it is thus not necessary to define a customization for each program option.