Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: adding configtest to service httpd options



On Apr 22,  8:49pm, zzapper wrote:
} Subject: Re: adding configtest to service httpd options
}
} Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote in
} news:160421180453.ZM18158@xxxxxxxxxxxxxxxxxxxxxx: 
} 
} > You need to change the assignment what='(...)' to add configtest to
} > the alternatives.
} > 
} Yep can't get this to work , but not a big priority .

Ah.  Hadn't actually looked closely at /etc/init.d/httpd, there is a
bit more to the issue than I thought.

} Are you implying that the completions only allow for standard actions
} and not optionals like configtest which may not be used by all
} versions of httpd?

I'm implying that the completions only allow for the actions that are
supported generically by any/all [or at least most] scripts to be
found in /etc/init.d, and that /etc/init.d/httpd adds several that are
unique.  If you attempt to complete after "service foo", then _init_d
looks for /etc/init.d/foo -- and if it finds it, it scans through that
file looking for "case" branches matching start, stop, status, etc.
It then offers whichever case-branches it finds as the completions.

/etc/init.d/httpd not only has case-branches that _init_d is not even
looking for, it also has case-branches that use syntax that the case-
branch search in _init_d won't match even if looking for the correct
words.  _init_d wants every case to look like " start)" or " stop)"
etc., but http has " graceful|help|configtest|fullstatus)" all in
one combined branch [at least in my copy].  _init_d is unprepared to
deal with that.

This is a situation in which a "good enough" generic completion was
created and special cases are *way* outside of what it covers; there
is no simple correction.



Messages sorted by: Reverse Date, Date, Thread, Author