X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fmemstat.c;h=a01c35baada79964e2275d4cec7fe94e99e2e1c3;hb=557de9b08007dd2b482778ba934574bcf7ee531f;hp=dcfb3af96ea15ec725170e18da546c62eb76c653;hpb=5ec04ab8c3a401ca0d73abe77a3e4d78f47eb1f6;p=awesomized%2Flibmemcached diff --git a/src/memstat.c b/src/memstat.c index dcfb3af9..a01c35ba 100644 --- a/src/memstat.c +++ b/src/memstat.c @@ -34,7 +34,7 @@ int main(int argc, char *argv[]) void options_parse(int argc, char *argv[]) { - static struct option long_options[] = + static struct option long_options[]= { {"version", no_argument, NULL, OPT_VERSION}, {"help", no_argument, NULL, OPT_HELP}, @@ -45,16 +45,23 @@ void options_parse(int argc, char *argv[]) {0, 0, 0, 0}, }; - int option_index = 0; + int option_index= 0; int option_rv; while (1) { - option_rv = getopt_long(argc, argv, "Vhvds:", long_options, &option_index); + option_rv= getopt_long(argc, argv, "Vhvds:", long_options, &option_index); if (option_rv == -1) break; - switch (option_rv) { + switch (option_rv) + { case 0: break; + case OPT_VERBOSE: /* --verbose or -v */ + opt_verbose = OPT_VERBOSE; + break; + case OPT_DEBUG: /* --debug or -d */ + opt_verbose = OPT_DEBUG; + break; case OPT_VERSION: /* --version or -V */ printf("memcache tools, memcat, v1.0\n"); exit(0); @@ -64,7 +71,7 @@ void options_parse(int argc, char *argv[]) exit(0); break; case OPT_SERVERS: /* --servers or -s */ - opt_servers = optarg; + opt_servers= optarg; break; case '?': /* getopt_long already printed an error message. */