Module: check_mk
Branch: master
Commit: a0a59a7c818fff530c22987c8a579423215e69de
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a0a59a7c818fff…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 16 18:16:50 2013 +0100
Added basic bash_completion (thanks to Gerard Mensoif)
---
doc/treasures/check_mk.bash_completion | 42 ++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/doc/treasures/check_mk.bash_completion
b/doc/treasures/check_mk.bash_completion
new file mode 100644
index 0000000..367a90b
--- /dev/null
+++ b/doc/treasures/check_mk.bash_completion
@@ -0,0 +1,42 @@
+# bash completion for check_mk
+#
+# This is a pretty basic version. If anyone out there got time to
+# really realize a completion for all check_mk options we would
+# really integrate this into the default installation.
+
+have check_mk &&
+_check_mk() {
+ # declaration des variables locales
+ local cur prev hostnames
+
+ COMPREPLY=()
+ _get_comp_words_by_ref cur prev
+
+ case $prev in
+ -I|-II|-d|--check-inventory)
+ hostnames=$(check_mk --list-hosts)
+ COMPREPLY=( $(compgen -W "${hostnames}" -- ${cur}) )
+ return 0
+ ;;
+ esac
+
+ # complete using basic options
+ COMPREPLY=( $( compgen -W '-I -II -u --cleanup-autochecks -N -C --compile \
+ -U --update -O --reload -R --restart -D --dump -d --check-inventory --list-hosts
\
+ --list-tag -L --list-checks -M --man --paths -X --check-config --backup --restore
\
+ --flush --donate --snmpwalk --snmpget --scan-parents -P --package --localize -V
\
+ --version -h --help -v -p -n -c --cache --no-cache --no-tcp --fake-dns --usewalk
\
+ --debug --procs --checks' -- "$cur" ) )
+
+ return 0
+
+} &&
+complete -F _check_mk check_mk
+
+# 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