[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-161-ga614028
Ville Skyttä
ville.skytta at iki.fi
Sun May 1 12:28:28 UTC 2011
The following commit has been merged in the master branch:
commit b202bc60f6724caf8fcc878a0446f6a3be9bc775
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Sun May 1 12:13:32 2011 +0300
cppcheck: New completion.
diff --git a/completions/Makefile.am b/completions/Makefile.am
index 1a92e1d..45a2367 100644
--- a/completions/Makefile.am
+++ b/completions/Makefile.am
@@ -27,6 +27,7 @@ bashcomp_DATA = abook \
cowsay \
cpan2dist \
cpio \
+ cppcheck \
crontab \
cups \
cryptsetup \
diff --git a/completions/cppcheck b/completions/cppcheck
new file mode 100644
index 0000000..b0d0ed7
--- /dev/null
+++ b/completions/cppcheck
@@ -0,0 +1,62 @@
+# bash completion for cppcheck(1)
+
+have cppcheck || return
+
+_cppcheck()
+{
+ local cur prev words cword
+ _init_completion -n = || return
+
+ local split=false
+ _split_longopt && split=true
+
+ case $prev in
+ --append|--exitcode-suppressions|--file-list|--rule-file|\
+ --suppressions-list)
+ _filedir
+ return
+ ;;
+ -D*|--rule|--suppress|--template)
+ return
+ ;;
+ --enable)
+ COMPREPLY=( $( compgen -W 'all style information unusedFunction
+ missingInclude' -- "$cur" ) )
+ return
+ ;;
+ --exitcode)
+ COMPREPLY=( $( compgen -W '{0..255}' -- "$cur" ) )
+ return
+ ;;
+ -I|-i)
+ _filedir -d
+ return
+ ;;
+ -j)
+ COMPREPLY=( $( compgen -W '{2..16}' -- "$cur" ) )
+ return
+ ;;
+ --xml-version)
+ COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) )
+ return
+ ;;
+ esac
+
+ $split && return
+
+ if [[ $cur == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == @(-D|*=) ]] && compopt -o nospace
+ else
+ _filedir @(cpp|cxx|cc|c++|c|tpp|txx)
+ fi
+} &&
+complete -F _cppcheck cppcheck
+
+# 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
diff --git a/test/completion/cppcheck.exp b/test/completion/cppcheck.exp
new file mode 100644
index 0000000..1cfb9c5
--- /dev/null
+++ b/test/completion/cppcheck.exp
@@ -0,0 +1 @@
+assert_source_completions cppcheck
diff --git a/test/lib/completions/a2ps.exp b/test/lib/completions/cppcheck.exp
similarity index 78%
copy from test/lib/completions/a2ps.exp
copy to test/lib/completions/cppcheck.exp
index 77cd07f..66caf27 100644
--- a/test/lib/completions/a2ps.exp
+++ b/test/lib/completions/cppcheck.exp
@@ -11,7 +11,7 @@ proc teardown {} {
setup
-assert_complete_any "a2ps "
+assert_complete_any "cppcheck "
sync_after_int
--
bash-completion
More information about the Bash-completion-commits
mailing list