nslookup: accept lowercase -type=soa, document query types

Usage: nslookup [-type=QUERY_TYPE] [-debug] HOST [DNS_SERVER]

    Query DNS about HOST

    QUERY_TYPE: soa,ns,a,aaaa,cname,mx,txt,ptr,any

function                                             old     new   delta
packed_usage                                       32189   32258     +69

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2018-04-15 12:57:32 +02:00
parent 6cdc3195a6
commit 4b6091f92c

View File

@ -24,7 +24,8 @@
//usage: IF_FEATURE_NSLOOKUP_BIG("[-type=QUERY_TYPE] [-debug] ") "HOST [DNS_SERVER]" //usage: IF_FEATURE_NSLOOKUP_BIG("[-type=QUERY_TYPE] [-debug] ") "HOST [DNS_SERVER]"
//usage:#define nslookup_full_usage "\n\n" //usage:#define nslookup_full_usage "\n\n"
//usage: "Query DNS about HOST" //usage: "Query DNS about HOST"
//usage: //usage: IF_FEATURE_NSLOOKUP_BIG("\n")
//usage: IF_FEATURE_NSLOOKUP_BIG("\nQUERY_TYPE: soa,ns,a,"IF_FEATURE_IPV6("aaaa,")"cname,mx,txt,ptr,any")
//usage:#define nslookup_example_usage //usage:#define nslookup_example_usage
//usage: "$ nslookup localhost\n" //usage: "$ nslookup localhost\n"
//usage: "Server: default\n" //usage: "Server: default\n"
@ -816,7 +817,7 @@ int nslookup_main(int argc UNUSED_PARAM, char **argv)
for (i = 0;; i++) { for (i = 0;; i++) {
if (i == ARRAY_SIZE(qtypes)) if (i == ARRAY_SIZE(qtypes))
bb_error_msg_and_die("invalid query type \"%s\"", val); bb_error_msg_and_die("invalid query type \"%s\"", val);
if (strcmp(qtypes[i].name, val) == 0) if (strcasecmp(qtypes[i].name, val) == 0)
break; break;
} }
types |= (1 << i); types |= (1 << i);