2016-06-10 15:56 GMT+02:00 Brad King <brad.k...@kitware.com>:

> 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.
>


You are right this part was obsolete.
To be honest I did not test the policy completion :-(


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

 Here you go.


-- 
Eric
From 003e68e5ef1e89036313b63bccd571a683894493 Mon Sep 17 00:00:00 2001
From: Eric NOULARD <eric.noul...@gmail.com>
Date: Fri, 10 Jun 2016 16:07:06 +0200
Subject: [PATCH 2/2] Update --help-policy completion with comtemporary cmake
 tools.

This was a leftover from previous patch.
---
 Auxiliary/bash-completion/cmake | 4 ++--
 Auxiliary/bash-completion/cpack | 4 ++--
 Auxiliary/bash-completion/ctest | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Auxiliary/bash-completion/cmake b/Auxiliary/bash-completion/cmake
index 6997d47..6061129 100644
--- a/Auxiliary/bash-completion/cmake
+++ b/Auxiliary/bash-completion/cmake
@@ -132,8 +132,8 @@ _cmake()
             return
             ;;
          --help-policy)
-            COMPREPLY=( $( compgen -W '$( cmake --help-policies 2>/dev/null |
-                grep "^  CMP" 2>/dev/null )' -- "$cur" ) )
+            COMPREPLY=( $( compgen -W '$( cmake --help-policy-list 2>/dev/null |
+                grep -v "^cmake version " )' -- "$cur" ) )
             return
             ;;
          --help-property)
diff --git a/Auxiliary/bash-completion/cpack b/Auxiliary/bash-completion/cpack
index 8f14a72..be29528 100644
--- a/Auxiliary/bash-completion/cpack
+++ b/Auxiliary/bash-completion/cpack
@@ -59,8 +59,8 @@ _cpack()
             return
             ;;
          --help-policy)
-            COMPREPLY=( $( compgen -W '$( cpack --help-policies 2>/dev/null |
-                grep "^  CMP" 2>/dev/null )' -- "$cur" ) )
+            COMPREPLY=( $( compgen -W '$( cpack --help-policy-list 2>/dev/null |
+                grep -v "^cpack version " )' -- "$cur" ) )
             return
             ;;
          --help-property)
diff --git a/Auxiliary/bash-completion/ctest b/Auxiliary/bash-completion/ctest
index de8fde1..71f47ba 100644
--- a/Auxiliary/bash-completion/ctest
+++ b/Auxiliary/bash-completion/ctest
@@ -89,8 +89,8 @@ _ctest()
             return
             ;;
          --help-policy)
-            COMPREPLY=( $( compgen -W '$( ctest --help-policies 2>/dev/null |
-                grep "^  CMP" 2>/dev/null )' -- "$cur" ) )
+            COMPREPLY=( $( compgen -W '$( ctest --help-policy-list 2>/dev/null |
+                grep -v "^ctest version " )' -- "$cur" ) )
             return
             ;;
          --help-property)
-- 
2.8.1

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to