On 09/25/2013 12:18 PM, Eric Noulard wrote:
> I think it would be simpler to use
> 
> grep -v " "
> 
> because help-*-list never contains a space (no variable or command
> have embedded space)

That's a much stronger assumption that is less future-proof.

In the long run I don't want to do any filtering at all and just
make sure the --help-*-list options display exactly what they should
and nothing more.  For now we need to tolerate existing CMake
behavior with the most specific filter possible.

> I think you missed a couple of cases in the cmake completion.

The only "tail" filters I left are in cache variable list output
which is not filtering out the version line.  A diff between mine
and yours shows that you missed one in cpack:

diff --git a/Docs/bash-completion/cpack b/Docs/bash-completion/cpack
index e3f611e..6df0e41 100644
--- a/Docs/bash-completion/cpack
+++ b/Docs/bash-completion/cpack
@@ -20,7 +20,7 @@ _cpack()
         -D)
             [[ $cur == *=* ]] && return # no completion for values
             COMPREPLY=( $( compgen -W '$( cpack --help-variable-list \
-                2>/dev/null | grep -v "^cmake version " )' -S = -- "$cur" ) )
+                2>/dev/null | tail -n +2 )' -S = -- "$cur" ) )
             compopt -o nospace
             return
             ;;

Anyway, I still prefer my proposal.  Please check that it works
for you as I never actually use this myself.

> Sidenote along bash completion feature:
> 
> completion of variables containing < > are not working that well

If someone knows how to improve this I would welcome it but that
is outside the scope of my change in question.

Thanks,
-Brad
--

Powered by www.kitware.com

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

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

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

Reply via email to