X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fbin%2Fcommon%2Foptions.cpp;h=c62020a3b6dd1b308a86844f7532a02786e31163;hb=aeac01630eed825d8a624e7fd7c107d47bb2e40c;hp=4583e7b73e9a2537b5daf2e1ed906b0cc0561b9d;hpb=2e9eb0803f1fc81bfe6c3e2dda0ed2cbe1aa6a76;p=awesomized%2Flibmemcached diff --git a/src/bin/common/options.cpp b/src/bin/common/options.cpp index 4583e7b7..c62020a3 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