bash completion needs updating to reflect latest command line options
There are a number of cases where the bash completions haven't been updated to reflect the changes over the past few feature releases. While checking another merge request, I noticed at least the following:
- CMake 3.14 added an asterisk in front of the default generator in the output of
cmake --help
(see !2682 (merged)). The bash completion uses that output to complete the-G
option, but the regular expression it uses doesn't account for that newly added asterisk. That means it doesn't complete for the default generator. - CMake 3.15 changed the documented log levels for
--loglevel
to uppercase (see !3521 (merged)), but the bash completion only completes lowercase values forerror
,warning
, etc. It should complete both lower and upper case. - CMake 3.16 renamed the
--loglevel
option to--log-level
(see !3899 (merged)) but the latter has no completion. Both should be treated equivalently. - CMake 3.16 - 3.18 added a number of new options of the form
--something=<file>
but they don't have completions. They need to be explicitly listed because they expect the=
instead of using a space between the option name and the file name. The options I could identify as missing are--trace-source
,--trace-redirect
and--profiling-output
.
Most of these seem like fairly uncontroversial fixes, but it is unclear which release we should backport such changes to, if at all. In the absence of any other opinion, I'd propose we put these on the 3.18 release branch.
Edited by Craig Scott