else\r
ptr= argv[optind];\r
\r
+ if (opt_verbose) {\r
+ static char *opstr[] = { "set", "add", "replace" };\r
+ printf("op: %s\nsource file: %s\nlength: %d\n"\r
+ "key: %s\nflags: %d\n expires: %ld\n",\r
+ opstr[opt_replace], argv[optind], sbuf.st_size,\r
+ ptr, opt_flags, opt_expires);\r
+ }\r
+\r
if (opt_replace == 0)\r
rc= memcached_set(memc, ptr, strlen(ptr),\r
mptr, sbuf.st_size,\r
\r
while (1) \r
{\r
- option_rv= getopt_long(argc, argv, "", long_options, &option_index);\r
+ option_rv= getopt_long(argc, argv, "Vhvds:", long_options, &option_index);\r
\r
if (option_rv == -1) break;\r
\r
switch (option_rv) {\r
case 0:\r
- if (long_options[option_index].name)\r
break;\r
- case OPT_VERSION: /* --version */\r
+ case OPT_VERSION: /* --version or -V */\r
printf("memcache tools, memcp, v1.0\n");\r
exit(0);\r
- case OPT_HELP: /* --help */\r
+ case OPT_HELP: /* --help or -h */\r
printf("useful help messages go here\n");\r
exit(0);\r
- case OPT_SERVERS: /* --servers */\r
+ case OPT_SERVERS: /* --servers or -s */\r
opt_servers= optarg;\r
break;\r
case OPT_FLAG: /* --flag */\r