[Cmake-commits] CMake branch, next, updated. v2.8.2-419-g2d8fd35

Eric Noulard eric.noulard at gmail.com
Fri Aug 13 11:12:58 EDT 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  2d8fd35699b05a4805b2b27447be38ebac317409 (commit)
       via  1715c96b3c5862cb7b566a224c66e16d15bfa466 (commit)
       via  e41f813d12fb8c3551d87a91435f9c4ba5375949 (commit)
      from  7c87bfedca075e7be87ff7c737102088b99969ec (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2d8fd35699b05a4805b2b27447be38ebac317409
commit 2d8fd35699b05a4805b2b27447be38ebac317409
Merge: 7c87bfe 1715c96
Author:     Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Fri Aug 13 17:12:44 2010 +0200
Commit:     Eric NOULARD <eric.noulard at gmail.com>
CommitDate: Fri Aug 13 17:12:44 2010 +0200

    Merge branch 'CMake-bash-completion' into next


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1715c96b3c5862cb7b566a224c66e16d15bfa466
commit 1715c96b3c5862cb7b566a224c66e16d15bfa466
Author:     Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Fri Aug 13 17:11:42 2010 +0200
Commit:     Eric NOULARD <eric.noulard at gmail.com>
CommitDate: Fri Aug 13 17:11:42 2010 +0200

    Improve cmake-completion (install doc, ctest -R completion)

diff --git a/Docs/cmake-completion b/Docs/cmake-completion
index ab6272a..011f3fa 100644
--- a/Docs/cmake-completion
+++ b/Docs/cmake-completion
@@ -16,6 +16,13 @@
 #
 # The file has been proposed for inclusion in the bash-completion package
 # https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312632&group_id=100114
+# In the meantime,
+#   1) If you want to test bash completion for cmake/cpack/ctest
+#      just source the current file at bash prompt
+#      . ./cmake-completion
+#
+#   2) If you want to install it for good copy this file to
+#      cp cmake-completion /etc/bash_completion.d/cmake
 #
 
 #
@@ -153,6 +160,11 @@ _ctest()
             COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
             return 0
             ;;
+        -R)
+            local running=$(for x in `ctest -N 2> /dev/null | grep "^  Test" | cut -d: -f 2`; do echo ${x} ; done )
+            COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
+            return 0
+            ;;
         *)
             ;;
     esac

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e41f813d12fb8c3551d87a91435f9c4ba5375949
commit e41f813d12fb8c3551d87a91435f9c4ba5375949
Author:     Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Sun Aug 1 14:31:32 2010 +0200
Commit:     Eric NOULARD <eric.noulard at gmail.com>
CommitDate: Sun Aug 1 14:31:32 2010 +0200

    Proposal for bash-completion support file

diff --git a/Docs/cmake-completion b/Docs/cmake-completion
new file mode 100644
index 0000000..ab6272a
--- /dev/null
+++ b/Docs/cmake-completion
@@ -0,0 +1,178 @@
+#
+# bash-completion file for CMake
+# Provided by Eric NOULARD - eric.noulard at gmail.com
+#
+# see http://bash-completion.alioth.debian.org/
+# and http://www.cmake.org
+#
+# We will try to complete cmake commands options
+# at 2 (or may be 3 levels)
+#  [cmake|cpack|ctest] <level0> <level1> <level2>
+#
+#  level0 is top level cmake/cpack/ctest options
+#  level1 is the first argument of level0 option
+#  level2 is the seconf argument of level1 argument
+#   FIXME: I don't know how to handle level2
+#
+# The file has been proposed for inclusion in the bash-completion package
+# https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312632&group_id=100114
+#
+
+#
+# cmake command
+#
+# have cmake &&
+_cmake()
+{
+    local cur prev opts words cword
+    COMPREPLY=()
+    cur="${COMP_WORDS[COMP_CWORD]}"
+    prev="${COMP_WORDS[COMP_CWORD-1]}"
+    # seems to be only available on bash-completion 1.2
+    #_get_comp_words_by_ref cur prev
+
+    # cmake command line option we want to complete
+    opts=`cmake --help | grep "^  \-.*=\ .*" | cut -d" " -f 3 | cut -d= -f 1 | cut -d[ -f 1`
+
+    #
+    #  Complete the arguments to some of
+    #  the most commonly used commands (Level 1).
+    #
+    case "${prev}" in
+        -E)
+            local running=$(for x in `cmake -E |&  grep "^  " | cut -d" " -f 3`; do echo ${x} ; done )
+            COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
+            return 0
+            ;;
+        --help-command)
+            local running=$(for x in `cmake --help-command-list`; do echo ${x} ; done )
+            COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
+            return 0
+            ;;
+        --help-module)
+            local running=$(for x in `cmake --help-module-list`; do echo ${x} ; done )
+            COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
+            return 0
+            ;;
+         --help-policy)
+            local running=$(for x in `cmake --help-policies | grep "^  CMP"`; do echo ${x} ; done )
+            COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
+            return 0
+            ;;
+         --help-property)
+            local running=$(for x in `cmake --help-property-list`; do echo ${x} ; done )
+            COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
+            return 0
+            ;;
+         --help-variable)
+            local running=$(for x in `cmake --help-variable-list`; do echo ${x} ; done )
+            COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
+            return 0
+            ;;
+        *)
+            ;;
+    esac
+
+    #
+    #  Complete the arguments to some of
+    #  the most commonly used commands (Level 2).
+    #   ?? How to do that ..
+
+    #
+    # Complete the option (Level 0 - right after cmake)
+    #
+    COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+} &&
+complete -F _cmake -o default cmake
+
+#
+# cpack command
+#
+#have cpack &&
+_cpack()
+{
+    local cur prev opts words cword
+    COMPREPLY=()
+    cur="${COMP_WORDS[COMP_CWORD]}"
+    prev="${COMP_WORDS[COMP_CWORD-1]}"
+    # seems to be only available on bash-completion 1.2
+    #_get_comp_words_by_ref cur prev
+
+    # cpack command line option we want to complete
+    opts=`cpack --help | grep "^  \-.*=\ .*"  | cut -d" " -f 3 | cut -d= -f 1`
+    opts="${opts} --help -V"
+
+    #
+    #  Complete the arguments to some of
+    #  the most commonly used commands (Level 1).
+    #
+    case "${prev}" in
+        -G)
+            local running=$(for x in `cpack --help | grep "^  .*=\ .*" | grep -v "^  -" | cut -d" " -f 3`; do echo ${x} ; done )
+            COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
+            return 0
+            ;;
+        --config)
+            COMPREPLY=( $(compgen -f ${cur}) )
+            return 0
+            ;;
+        *)
+            ;;
+    esac
+
+    #
+    # Complete the option (Level 0 - right after cmake)
+    #
+    COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+} &&
+complete -F _cpack -o default cpack
+
+#
+# cmake command
+#
+# have ctest &&
+_ctest()
+{
+    local cur prev opts words cword
+    COMPREPLY=()
+    cur="${COMP_WORDS[COMP_CWORD]}"
+    prev="${COMP_WORDS[COMP_CWORD-1]}"
+    # seems to be only available on bash-completion 1.2
+    #_get_comp_words_by_ref cur prev
+
+    # cmake command line option we want to complete
+    opts=`ctest --help | grep "\-\-.*" | cut -d" " -f 3 | sed s/,/\\\n/g`
+
+    #
+    #  Complete the arguments to some of
+    #  the most commonly used commands (Level 1).
+    #
+    case "${prev}" in
+        --help-command)
+            local running=$(for x in `ctest --help-command-list`; do echo ${x} ; done )
+            COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
+            return 0
+            ;;
+        *)
+            ;;
+    esac
+
+    #
+    #  Complete the arguments to some of
+    #  the most commonly used commands (Level 2).
+    #   ?? How to do that ..
+
+    #
+    # Complete the option (Level 0 - right after cmake)
+    #
+    COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+} &&
+complete -F _ctest -o default ctest
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
\ No newline at end of file

-----------------------------------------------------------------------

Summary of changes:
 Docs/cmake-completion |  190 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 190 insertions(+), 0 deletions(-)
 create mode 100644 Docs/cmake-completion


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list