- memcached_st memc;
- client_options opt{PROGRAM_NAME, PROGRAM_VERSION, PROGRAM_DESCRIPTION, {
- client_options::flag::help,
- client_options::flag::version,
- client_options::flag::verbose,
- client_options::flag::debug,
- client_options::flag::quiet,
- client_options::flag::servers,
- client_options::flag::binary,
- client_options::flag::username,
- client_options::flag::password,
- client_options::flag::hash,
- client_options::flag::flags,
- client_options::flag::file,
- }};
-
- if (!opt.parse(argc, argv)) {
- exit(EXIT_FAILURE);
- }
- if (opt.flags.help) {
- opt.printHelp("key [ key ... ]");
- exit(EXIT_SUCCESS);
+ client_options opt{PROGRAM_NAME, PROGRAM_VERSION, PROGRAM_DESCRIPTION, "key [key ...]"};
+
+ for (const auto &def : opt.defaults) {
+ opt.add(def);