(ws) add a dnslookup sub-command, to get the ip address of a remote host

This commit is contained in:
Benjamin Sergeant
2020-01-22 21:11:48 -08:00
parent 527308a049
commit fad9f89846
6 changed files with 49 additions and 1 deletions

View File

@ -338,6 +338,9 @@ int main(int argc, char** argv)
minidumpApp->add_option("--key", key, "Sentry Key")->required();
minidumpApp->add_flag("-v", verbose, "Verbose");
CLI::App* dnsLookupApp = app.add_subcommand("dnslookup", "DNS lookup");
dnsLookupApp->add_option("host", hostname, "Hostname")->required();
CLI11_PARSE(app, argc, argv);
// pid file handling
@ -509,6 +512,10 @@ int main(int argc, char** argv)
{
ret = ix::ws_sentry_minidump_upload(metadata, minidump, project, key, verbose);
}
else if (app.got_subcommand("dnslookup"))
{
ret = ix::ws_dns_lookup(hostname);
}
else if (version)
{
spdlog::info("ws {}", ix::userAgent());