+static char *analyze_mode= NULL;
+
+static struct option long_options[]=
+{
+ {(OPTIONSTRING)"version", no_argument, NULL, OPT_VERSION},
+ {(OPTIONSTRING)"help", no_argument, NULL, OPT_HELP},
+ {(OPTIONSTRING)"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
+ {(OPTIONSTRING)"debug", no_argument, &opt_verbose, OPT_DEBUG},
+ {(OPTIONSTRING)"servers", required_argument, NULL, OPT_SERVERS},
+ {(OPTIONSTRING)"flag", no_argument, &opt_displayflag, OPT_FLAG},
+ {(OPTIONSTRING)"analyze", optional_argument, NULL, OPT_ANALYZE},
+ {0, 0, 0, 0},
+};
+
+
+static memcached_return_t stat_printer(memcached_server_instance_st instance,
+ const char *key, size_t key_length,
+ const char *value, size_t value_length,
+ void *context)
+{
+ static memcached_server_instance_st last= NULL;
+ (void)context;
+
+ if (last != instance)
+ {
+ printf("Server: %s (%u)\n", memcached_server_name(instance),
+ (uint32_t)memcached_server_port(instance));
+ last= instance;
+ }
+
+ printf("\t %.*s: %.*s\n", (int)key_length, key, (int)value_length, value);
+
+ return MEMCACHED_SUCCESS;
+}