From: Michael Wallner Date: Wed, 18 Nov 2020 11:19:27 +0000 (+0100) Subject: bin: consolidate clients X-Git-Tag: 1.1.0-beta1~100 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=adec10db28a123bc0d64f8d1ff70b51b5ea5c435;p=m6w6%2Flibmemcached bin: consolidate clients --- 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