Subject: bash-completion: Please add munindoc compltion for munin-node
Package: bash-completion
Version: 1:1.1-1
Severity: wishlist

Hi,

I see you've recently added completion configuration for munin-node. A handy
feature would be to add munindoc completion to it, so that users will be able
to access munin plugins pod documentation using munindoc with bash completion.

See attached patch which adds this functionality.

Thanks,
    Tom Feiner

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.28-16-generic (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages bash-completion depends on:
ii  bash                          4.0-4      The GNU Bourne Again SHell

bash-completion recommends no packages.

bash-completion suggests no packages.

-- no debconf information
diff --git a/contrib/munin-node b/contrib/munin-node
index af8225c..cfe1f27 100644
--- a/contrib/munin-node
+++ b/contrib/munin-node
@@ -30,6 +30,20 @@ _munin_run()
 } &&
 complete -F _munin_run munin-run
 
+have munindoc &&
+_munindoc()
+{
+    local cur prev
+
+    COMPREPLY=()
+    cur=`_get_cword`
+    prev=${COMP_WORDS[COMP_CWORD-1]}
+
+    COMPREPLY=( $( compgen -W '$( command ls /usr/share/munin/plugins )' \
+        -- "$cur" ) )
+} &&
+complete -F _munindoc munindoc
+
 have munin-update &&
 _munin_update()
 {

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to