Fixed "service" completion, thanks to John Hedges (Debian: #586210)
The patch makes it safe even when every file in /etc/init.d/* has a proper completion (unlikely, but seems like it happened). Thanks to John Hedges <john@drystone.co.uk> for the patch, slightly modified to make it more compact.
This commit is contained in:
parent
c858043cbc
commit
1f8b55a92a
2
CHANGES
2
CHANGES
@ -1,7 +1,7 @@
|
|||||||
bash-completion (2.x)
|
bash-completion (2.x)
|
||||||
|
|
||||||
[ David Paleino ]
|
[ David Paleino ]
|
||||||
* Start work on 2.0
|
* Fixed "service" completion, thanks to John Hedges (Debian: #586210)
|
||||||
|
|
||||||
[ Ville Skyttä ]
|
[ Ville Skyttä ]
|
||||||
* Activate hping2 completion also for hping and hping3.
|
* Activate hping2 completion also for hping and hping3.
|
||||||
|
@ -32,9 +32,10 @@ _service()
|
|||||||
return 0
|
return 0
|
||||||
} &&
|
} &&
|
||||||
complete -F _service service
|
complete -F _service service
|
||||||
[ -d /etc/init.d/ ] && complete -F _service -o default \
|
[ -d /etc/init.d/ ] && (
|
||||||
$(for i in /etc/init.d/*; do
|
services=$(for i in /etc/init.d/*; do
|
||||||
complete -p ${i##*/} &>/dev/null || printf '%s\n' ${i##*/}; done)
|
complete -p ${i##*/} &>/dev/null || printf '%s\n' ${i##*/}; done)
|
||||||
|
[ -n "$services" ] && complete -F _service -o default $services;)
|
||||||
|
|
||||||
# Local variables:
|
# Local variables:
|
||||||
# mode: shell-script
|
# mode: shell-script
|
||||||
|
Loading…
x
Reference in New Issue
Block a user