Package: bash
Version: 3.0-16
Severity: wishlist
Tags: patch

There is no bash-completion for invoke-rc.d. It would be good if there
is a completion for every executable file in /etc/init.d/ and "start,
stop ...".

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.13
Locale: LANG=en_US.ISO-8859-15, LC_CTYPE=en_US.ISO-8859-15 (charmap=ISO-8859-15)

Versions of packages bash depends on:
ii  base-files                    3.1.7      Debian base system miscellaneous f
ii  libc6                         2.3.5-6    GNU C Library: Shared libraries an
ii  libncurses5                   5.4-9      Shared libraries for terminal hand
ii  passwd                        1:4.0.3-39 change and administer password and

bash recommends no packages.

-- no debconf information
--- bash_completion.old 2005-09-10 00:44:54.000000000 +0200
+++ bash_completion     2005-09-10 00:30:56.000000000 +0200
@@ -3238,6 +3238,32 @@
 } &&
 complete -F _mysqladmin mysqladmin
 
+# invoke-rc.d(8) completion
+#
+have invoke-rc.d &&
+_invokercd()
+{
+    local cur prev options
+
+    COMPREPLY=()
+    cur=${COMP_WORDS[COMP_CWORD]}
+    prev=${COMP_WORDS[COMP_CWORD-1]}
+
+    case $prev in
+        invoke-rc.d)
+        files=$( find /etc/init.d/ -perm +u=x | sed 's|^/etc/init.d/||' )
+        COMPREPLY=( $( compgen -W "${files}" -- $cur ) )
+        return 0
+        ;;
+
+        *)
+        COMPREPLY=( $( compgen -W 'start stop restart reload force-reload' -- 
$cur ) )
+        return 0
+        ;;
+    esac
+} &&
+complete -F _invokercd invoke-rc.d
+
 # gzip(1) completion
 #
 have gzip &&

Reply via email to