X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fbin%2Fcommon%2Foptions.cpp;h=8c520b8f152d561dfb904cd9bb33ac3863fd13c4;hb=dfdcce95b625e98144c1681f05b337648b92f20f;hp=229f4f0f943a1b55997e7dce174cc9092d7c6071;hpb=f2d0ed355899d265edbcc7156dace706df2f160a;p=awesomized%2Flibmemcached diff --git a/src/bin/common/options.cpp b/src/bin/common/options.cpp index 229f4f0f..8c520b8f 100644 --- a/src/bin/common/options.cpp +++ b/src/bin/common/options.cpp @@ -14,13 +14,6 @@ */ #include "options.hpp" -#include - -option client_options::null_opt{}; -const client_options::extended_option client_options::null_ext_opt{ - client_options::null_opt, - {}, {}, {},nullptr, false -}; void client_options::print_version() const { std::cout << prog_name << " v" << prog_vers << " (libmemcached v" << LIBMEMCACHED_VERSION_STRING << ")" @@ -84,8 +77,7 @@ void client_options::print_help() const { std::cout << "\n\t\t" << ext.help << "\n"; } - const auto &servers = get("servers"); - if (&servers != &null_ext_opt) { + if (has("servers")) { std::cout << "\nEnvironment:\n"; std::cout << "\tMEMCACHED_SERVERS=\n"; std::cout << "\t\tList of servers to use if `-s|--servers` was not provided.\n"; @@ -95,7 +87,7 @@ void client_options::print_help() const { bool client_options::parse(int argc, char **argv, char ***argp) { /* extern */ optind = 1; - auto &debug = get("debug"); + auto debug = has("debug") ? &get("debug") : nullptr; std::string short_opts{}; std::vector