Bug#327414: bash: no completion for invoke-rc.d (forwarded from Jan Christoph Ebersbach)
On Sat 10 Sep 2005 at 14:09:15 +0200, you wrote: X-Loop: [EMAIL PROTECTED] Reply-To: Jan Christoph Ebersbach [EMAIL PROTECTED], [EMAIL PROTECTED] X-Debian-PR-Message: report 327414 X-Debian-PR-Package: bash X-Debian-PR-Keywords: patch In-Reply-To: [EMAIL PROTECTED] User-Agent: Mutt/1.5.10i Delivered-To: [EMAIL PROTECTED] X-Virus-Scanned: by amavisd-new at cs.tu-berlin.de (including spamassassin) X-Spam-Status: No, hits=0 tagged_above=0 required=3 tests= X-Spam-Level: Resent-From: Jan Christoph Ebersbach [EMAIL PROTECTED] Resent-To: debian-bugs-dist@lists.debian.org Resent-CC: Matthias Klose [EMAIL PROTECTED] Resent-Date: Sat, 10 Sep 2005 09:18:09 UTC Resent-Message-ID: [EMAIL PROTECTED] Resent-Sender: Debian BTS [EMAIL PROTECTED] From: Jan Christoph Ebersbach [EMAIL PROTECTED] To: Justin Pryzby [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Bug#327414: bash: no completion for invoke-rc.d Date: Sat, 10 Sep 2005 11:05:09 +0200 On Sat 10-09-2005, Jan Christoph Ebersbach wrote: On Fri 09-09-2005, Justin Pryzby wrote: I agree! And it should work with sudo, too. Your patch doesn't implement /etc/init.d/$foo start,stop completion, correct? The start,stop completion should work with my patch. If the previous word is not invoke-rc.d, start, stop ... will be completed. +*) COMPREPLY=( $( compgen -W 'start stop restart reload +force-reload' -- $cur ) ) return 0 ;; Ah, there is a bug - the find-parameter -perm +u=x should be -perm +111 Here is the correct patch. --- bash_completion.old 2005-09-10 00:44:54.0 +0200 +++ bash_completion 2005-09-10 10:58:44.0 +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 +111 | 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 Added for next release. Ian -- Ian Macdonald | It's God. No, not Richard Stallman, or [EMAIL PROTECTED] | Linus Torvalds, but God. (By Matt Welsh) http://www.caliban.org/ | | | -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#327414: bash: no completion for invoke-rc.d
I found out that service command which is not present in debian and make quite the thame job is handled by bash_completion. I looked into the script an I've seen that there's a function almost ready to use : service() . I changed a few lines and it seem to work, with all /etc/init.d script as first parameter and with {start|stop|reload|...} in second parameter when available. I hope you will use it :-) Here is the patch : http://madcat227.free.fr/debian/forum/completion/bash_completion.diff -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#327414: bash: no completion for invoke-rc.d
On Fri 09-09-2005, Justin Pryzby wrote: I agree! And it should work with sudo, too. Your patch doesn't implement /etc/init.d/$foo start,stop completion, correct? The start,stop completion should work with my patch. If the previous word is not invoke-rc.d, start, stop ... will be completed. +*) +COMPREPLY=( $( compgen -W 'start stop restart reload force-reload' -- $cur ) ) +return 0 +;; -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#327414: bash: no completion for invoke-rc.d
On Sat 10-09-2005, Jan Christoph Ebersbach wrote: On Fri 09-09-2005, Justin Pryzby wrote: I agree! And it should work with sudo, too. Your patch doesn't implement /etc/init.d/$foo start,stop completion, correct? The start,stop completion should work with my patch. If the previous word is not invoke-rc.d, start, stop ... will be completed. +*) COMPREPLY=( $( compgen -W 'start stop restart reload +force-reload' -- $cur ) ) return 0 ;; Ah, there is a bug - the find-parameter -perm +u=x should be -perm +111 Here is the correct patch. --- bash_completion.old 2005-09-10 00:44:54.0 +0200 +++ bash_completion 2005-09-10 10:58:44.0 +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 +111 | 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
Bug#327414: bash: no completion for invoke-rc.d
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-files3.1.7 Debian base system miscellaneous f ii libc6 2.3.5-6GNU C Library: Shared libraries an ii libncurses5 5.4-9 Shared libraries for terminal hand ii passwd1: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.0 +0200 +++ bash_completion 2005-09-10 00:30:56.0 +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
Bug#327414: bash: no completion for invoke-rc.d
On Sat, Sep 10, 2005 at 12:50:35AM +0200, Jan Christoph Ebersbach wrote: 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 I agree! And it should work with sudo, too. Your patch doesn't implement /etc/init.d/$foo start,stop completion, correct? -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]