[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.90-55-ged17034

Ville Skyttä ville.skytta at iki.fi
Sun Nov 20 15:56:32 UTC 2011


The following commit has been merged in the master branch:
commit ed1703497476eaf12e1d630caf4caa4aabc3acdc
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sun Nov 20 17:54:36 2011 +0200

    ccache: New completion.

diff --git a/completions/Makefile.am b/completions/Makefile.am
index e2137ed..e67f9d1 100644
--- a/completions/Makefile.am
+++ b/completions/Makefile.am
@@ -28,6 +28,7 @@ bashcomp_DATA = a2x \
 		cal \
 		cancel \
 		cardctl \
+		ccache \
 		cfagent \
 		cfrun \
 		chage \
diff --git a/completions/ccache b/completions/ccache
new file mode 100644
index 0000000..63f5a1c
--- /dev/null
+++ b/completions/ccache
@@ -0,0 +1,26 @@
+# ccache(1) completion                                     -*- shell-script -*-
+
+_ccache()
+{
+    local cur prev words cword split
+    _init_completion -s || return
+
+    if [[ $COMP_CWORD -eq 1 && ${COMP_WORDS[COMP_CWORD]} != -* ]]; then
+        _command_offset 1
+        return
+    fi
+
+    case $prev in
+        -h|--help|-V|--version|-F|--max-files|-M|--max-size)
+            return
+            ;;
+    esac
+
+    $split && return
+
+    COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+    [[ $COMPREPLY == *= ]] && compopt -o nospace
+} &&
+complete -F _ccache ccache
+
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/test/completion/ccache.exp b/test/completion/ccache.exp
new file mode 100644
index 0000000..4d88bf9
--- /dev/null
+++ b/test/completion/ccache.exp
@@ -0,0 +1 @@
+assert_source_completions ccache
diff --git a/test/lib/completions/abook.exp b/test/lib/completions/ccache.exp
similarity index 78%
copy from test/lib/completions/abook.exp
copy to test/lib/completions/ccache.exp
index 43f6272..156c881 100644
--- a/test/lib/completions/abook.exp
+++ b/test/lib/completions/ccache.exp
@@ -11,9 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "abook "
-
-
+assert_complete_any "ccache -"
 sync_after_int
 
 

-- 
bash-completion



More information about the Bash-completion-commits mailing list