[Bash-completion-devel] [bash-completion-Bugs][313065] bash-completion-1.3 doesn't work for "sudo /etc/init.d/xxx <TAB>"

bash-completion-bugs at alioth.debian.org bash-completion-bugs at alioth.debian.org
Tue Apr 12 06:24:22 UTC 2011


Bugs item #313065, was changed at 2011-03-30 22:19 by Ville Skyttä 
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=313065&group_id=100114

>Status: Closed
Priority: 3
Submitted By: Nobody (None)
Assigned to: Nobody (None)
Summary: bash-completion-1.3 doesn't work for "sudo /etc/init.d/xxx <TAB>" 
Distribution: Gentoo
Originally reported in: Gentoo Bugzilla
Milestone: None
>Status: Invalid
Original bug number: 360083


Initial Comment:
After typing "sudo /etc/init.d/sshd <TAB>", local files instead of command options(start, stop, etc.) are listed.
The old version 1.2 works fine.

I noticed that the code "complete -p $cmd" has been changed to "complete -p ${cmd##*/}".
Maybe you can check twice: first "complete -p $cmd", and if it fails, run "complete -p ${cmd##*/}"?

James

----------------------------------------------------------------------

>Comment By: Ville Skyttä  (scop-guest)
Date: 2011-04-12 09:24

Message:
_gentoo_style_init is not our function, so I suggest investigating this with Gentoo.  If anybody can reproduce this with the completions shipped by us, feel free to reopen.

----------------------------------------------------------------------

Comment By: James  (jamesjjx-guest)
Date: 2011-04-10 22:52

Message:
james at localhost ~ $ complete | grep sshd
complete -F _gentoo_style_init /etc/init.d/sshd

So I only have completion for /etc/init.d/sshd, no completion for sshd.

Let me make it clearer:
for any service(not only sshd) in the directory of /etc/init.d
1. "/etc/init.d/XXX <TAB>" works correctly by listing options like start, stop, etc.
2. "sudo /etc/init.d/XXX <TAB>" lists local files

James

----------------------------------------------------------------------

Comment By: Ville Skyttä  (scop-guest)
Date: 2011-03-30 23:27

Message:
Works fine for me.  Do you have a separate completion for sshd installed - what does "complete -p sshd" output for you?  

----------------------------------------------------------------------

You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=313065&group_id=100114



More information about the Bash-completion-devel mailing list