[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
Sun Apr 10 19:52:50 UTC 2011


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

Status: Open
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: None
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: James  (jamesjjx-guest)
Date: 2011-04-11 03: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-31 04: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