typedef enum {
- OPT_SERVERS= 1,
- OPT_VERSION,
- OPT_HELP,
- OPT_VERBOSE,
- OPT_DEBUG,
- OPT_FLAG,
+ OPT_SERVERS= 's',
+ OPT_VERSION= 'V',
+ OPT_HELP= 'h',
+ OPT_VERBOSE= 'v',
+ OPT_DEBUG= 'd',
+ OPT_FLAG= 257,
OPT_EXPIRE,
OPT_SET,
OPT_REPLACE,
\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
if (option_rv == -1) break;\r
switch (option_rv) {\r
case 0:\r
break;\r
- case OPT_VERSION: /* --version */\r
+ case OPT_VERSION: /* --version or -V */\r
printf("memcache tools, memcat, v1.0\n");\r
exit(0);\r
break;\r
- case OPT_HELP: /* --help */\r
+ case OPT_HELP: /* --help or -h */\r
printf("useful help messages go here\n");\r
exit(0);\r
break;\r
- case OPT_SERVERS: /* --servers */\r
+ case OPT_SERVERS: /* --servers or -s */\r
opt_servers= optarg;\r
break;\r
case '?':\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
\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
if (option_rv == -1) break;\r
switch (option_rv) {\r
case 0:\r
break;\r
- case OPT_VERSION: /* --version */\r
+ case OPT_VERSION: /* --version or -V */\r
printf("memcache tools, memrm, v1.0\n");\r
exit(0);\r
break;\r
- case OPT_HELP: /* --help */\r
+ case OPT_HELP: /* --help or -h */\r
printf("useful help messages go here\n");\r
exit(0);\r
break;\r
- case OPT_SERVERS: /* --servers */\r
+ case OPT_SERVERS: /* --servers or -s */\r
opt_servers = optarg;\r
break;\r
case OPT_EXPIRE: /* --expire */\r
while (1)
{
- option_rv = getopt_long(argc, argv, "", long_options, &option_index);
+ option_rv = getopt_long(argc, argv, "Vhvds:", long_options, &option_index);
if (option_rv == -1) break;
switch (option_rv) {
case 0:
break;
- case OPT_VERSION: /* --version */
+ case OPT_VERSION: /* --version or -V */
printf("memcache tools, memcat, v1.0\n");
exit(0);
break;
- case OPT_HELP: /* --help */
+ case OPT_HELP: /* --help or -h */
printf("useful help messages go here\n");
exit(0);
break;
- case OPT_SERVERS: /* --servers */
+ case OPT_SERVERS: /* --servers or -s */
opt_servers = optarg;
break;
case '?':