add single letter command line options
[awesomized/libmemcached] / src / memcp.c
index 88cbc351372588341757f1caecd46a4127ba7845..90d3fb375b574f2a5abb690e683085ef44753f0a 100644 (file)
@@ -102,21 +102,20 @@ void options_parse(int argc, char *argv[])
 \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