[Bash-completion-devel] [SCM] bash-completion branch, master, updated. 1.3-512-g9717124

Ville Skyttä ville.skytta at iki.fi
Sun Nov 6 15:44:38 UTC 2011


On 11/06/2011 06:12 PM, Igor Murzov wrote:

> This would not work in Slackware as it does have /etc/rc.d/init.d directory and it's there to provide some compatibility with Red Hat "solely for commercial (or other) software that expects to find Red Hat-isms" :)

Oh, damn.

> But let me say, I can't see /etc/xinetd.d or `systemctl` anywhere, so
the whole _services() is probably useless in Slackware anyway.

I've eyeballed the xinetd.d part earlier too and I have a feeling that
it shouldn't be used in this context anyway and that part should
probably be just removed.  xinetd services are not to my knowledge
managed by the same tools or used the same way as sysv init ones anyway.

systemctl comes from systemd, but that part is very much optional and
should stay there.  http://freedesktop.org/wiki/Software/systemd

> -    if [[ $1 == /etc?(/rc.d)/init.d/* ]]; then
> +    if [[ $1 == /etc?(/rc.d)/init.d/* || \
> +        ( $1 == /etc/rc.d/* && -f /etc/slackware-version ) ]]; then
> 
> Is this better than "if [[ "$1" == /etc/@(rc.d|init.d)/* ]]; then" ? I think, this simpler condition will not break anything.

It would then trigger for for example /etc/rc.d/rc.sysinit on my system
which would not be the right thing to do.  Not sure if it's a big deal
though.

>          COMPREPLY=( $( compgen -W '`sed -e "y/|/ /" \
>              -ne "s/^.*\(U\|msg_u\)sage.*{\(.*\)}.*$/\2/p" \
>              $sysvdir/${prev##*/} 2>/dev/null` start stop' -- "$cur" ) )
> 
> I don't understand why use "$sysvdir/${prev##*/}" instead of plain "$prev". Can we drop $sysvdir completely here?

Nope, that would not work when completing for example "service httpd
<TAB>" -- $prev == httpd there, and the sed wouldn't work with that.



More information about the Bash-completion-devel mailing list