musl-utils: add support for the -s switch to getent
glibc getent supports a `-s’ switch for choosing services - this feature is missing in the getent implementation from musl-utils.
I use getent to resolve host names in a script and use `-s’ to query either the /etc/hosts file (`getent -s files hosts ‘), or actual DNS (`getent -s dns hosts ’).
The former could be worked around by parsing the hosts file (at the cost
of additional code), but there’s no way to skip the hosts file lookup to
cover the latter case.
Of course, I could use a tool like host/dig, but I intentionally chose
getent, to avoid the additional dependency on bind-tools.
Any chance of this feature being added ?
(from redmine: issue id 9278, created on 2018-08-18, closed on 2018-08-21)