diff options
| author | David Paleino <d.paleino@gmail.com> | 2009-10-10 17:15:58 +0200 |
|---|---|---|
| committer | David Paleino <d.paleino@gmail.com> | 2009-10-10 17:15:58 +0200 |
| commit | e5a9b6220e93ca656fd9774c6aefa78241edca6f (patch) | |
| tree | 4a65aa19b18fe2e8dcec24a1c97ce9746a6f91ff /contrib/munin-node | |
| parent | 96d00c3d7f1912d4f3f76f8ea21ef68d179b8b30 (diff) | |
| download | bash-completion-upstream/1.1.tar.gz | |
Imported Upstream version 1.1upstream/1.1
Diffstat (limited to 'contrib/munin-node')
| -rw-r--r-- | contrib/munin-node | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/contrib/munin-node b/contrib/munin-node new file mode 100644 index 00000000..2753fc2a --- /dev/null +++ b/contrib/munin-node @@ -0,0 +1,103 @@ +# bash completion for munin node + +have munin-run && +_munin-run() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case $prev in + --@(config|sconffile)) + _filedir + return 0 + ;; + --@(service|sconf)dir) + _filedir -d + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--config --servicedir --sconfdir \ + --sconffile --help --debug --version' -- "$cur" ) ) + else + COMPREPLY=( $( compgen -W '$( command ls /etc/munin/plugins )' \ + -- "$cur" ) ) + fi +} && +complete -F _munin-run munin-run + +have munin-update && +_munin-update() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case $prev in + --config) + _filedir + return 0 + ;; + --host) + _known_hosts_real "$cur" + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--force-root --[no]force-root \ + --service --host --config --help --debug --nodebug \ + --fork --nofork --stdout --nostdout --timeout' -- "$cur" ) ) + fi +} && +complete -F _munin-update munin-update + +have munin-node-configure && +_munin-node-configure() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case $prev in + --config) + _filedir + return 0 + ;; + --@(service|lib)dir) + _filedir -d + return 0 + ;; + --snmp) + _known_hosts_real "$cur" + return 0 + ;; + --snmpversion) + COMPREPLY=( $( compgen -W '1 2c 3' -- "$cur" ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--help --version --debug --config \ + --servicedir --libdir --families --suggest --shell \ + --remove-also --snmp --snmpversion --snmpcommunity' -- "$cur" ) ) + fi +} && +complete -F _munin-node-configure munin-node-configure + +# 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 |
