[cmake-developers] Update bash completion scripts

Brad King brad.king at kitware.com
Fri Jun 10 09:56:46 EDT 2016


On 06/10/2016 09:31 AM, Eric Noulard wrote:
> Here comes an update of the bash completion scripts.
> All of them now handle the same set of --help-xxx options
> the handling of --help-manual has been added.

Thanks, applied:

 bash-completion: Add cmake --help-manual
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f67afbdc

 bash-completion: Add ctest --help-{manual,module,policy,property,variable}
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c8178a77

 bash-completion: Add cpack --help-{manual,module,policy,property}
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eacb75de

> +         --help-policy)
> +            COMPREPLY=( $( compgen -W '$( ctest --help-policies 2>/dev/null |
> +                grep "^  CMP" 2>/dev/null )' -- "$cur" ) )
> +            return
> +            ;;

Does this actually work?  IIRC older CMake versions did not
have `--help-policy-list` so the `--help-policies` hack was
used.  However, I don't know if the output format of the
latter will be matched by the `grep` anymore.

If needed, please post a follow-up patch to fix policy completion
for cmake, ctest, and cpack.

Thanks,
-Brad



More information about the cmake-developers mailing list