From: Pieter Lexis Date: Fri, 29 Apr 2016 17:50:49 +0000 (+0200) Subject: Add --version to nproxy X-Git-Tag: rec-4.0.0-alpha3~19^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5df3c7840750275c1a89fbf2207c1563f8a617d;p=thirdparty%2Fpdns.git Add --version to nproxy --- diff --git a/pdns/nproxy.cc b/pdns/nproxy.cc index 0f5391d773..96d8eeb3fe 100644 --- a/pdns/nproxy.cc +++ b/pdns/nproxy.cc @@ -182,6 +182,11 @@ void expireOldNotifications() void daemonize(int null_fd); +void usage(po::options_description &desc) { + cerr<<"nproxy"<(), "IP address of PowerDNS server") ("chroot", po::value(), "chroot to this directory for additional security") ("setuid", po::value(), "setuid to this numerical user id") @@ -205,12 +211,18 @@ try po::notify(g_vm); if (g_vm.count("help")) { - cerr << desc << "\n"; + usage(desc); + return EXIT_SUCCESS; + } + + if (g_vm.count("version")) { + cerr << "nproxy " << VERSION << endl; return EXIT_SUCCESS; } if(!g_vm.count("powerdns-address")) { - cerr<<"Mandatory setting 'powerdns-address' unset:\n"<