projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Missing hosts file.
[m6w6/libmemcached]
/
src
/
memrm.c
diff --git
a/src/memrm.c
b/src/memrm.c
index e07654f3cad4a7968c5c90ec3fcf97f0dfffe0c4..2df86838ace4cad0d77437868bdacbabf971357e 100644
(file)
--- a/
src/memrm.c
+++ b/
src/memrm.c
@@
-9,6
+9,9
@@
static int opt_verbose= 0;
static time_t opt_expire= 0;
static char *opt_servers= NULL;
static time_t opt_expire= 0;
static char *opt_servers= NULL;
+#define PROGRAM_NAME "memrm"
+#define PROGRAM_DESCRIPTION "Erase a key or set of keys from a memcached cluster."
+
/* Prototypes */
void options_parse(int argc, char *argv[]);
/* Prototypes */
void options_parse(int argc, char *argv[]);
@@
-23,7
+26,7
@@
int main(int argc, char *argv[])
if (!opt_servers)
return 0;
if (!opt_servers)
return 0;
- memc= memcached_
init
(NULL);
+ memc= memcached_
create
(NULL);
servers= parse_opt_servers(opt_servers);
memcached_server_push(memc, servers);
servers= parse_opt_servers(opt_servers);
memcached_server_push(memc, servers);
@@
-44,7
+47,7
@@
int main(int argc, char *argv[])
optind++;
}
optind++;
}
- memcached_
deinit
(memc);
+ memcached_
free
(memc);
free(opt_servers);
free(opt_servers);
@@
-54,6
+57,11
@@
int main(int argc, char *argv[])
void options_parse(int argc, char *argv[])
{
void options_parse(int argc, char *argv[])
{
+ memcached_programs_help_st help_options[]=
+ {
+ {0},
+ };
+
static struct option long_options[]=
{
{"version", no_argument, NULL, OPT_VERSION},
static struct option long_options[]=
{
{"version", no_argument, NULL, OPT_VERSION},
@@
-82,12
+90,10
@@
void options_parse(int argc, char *argv[])
opt_verbose = OPT_DEBUG;
break;
case OPT_VERSION: /* --version or -V */
opt_verbose = OPT_DEBUG;
break;
case OPT_VERSION: /* --version or -V */
- printf("memcache tools, memrm, v1.0\n");
- exit(0);
+ version_command(PROGRAM_NAME);
break;
case OPT_HELP: /* --help or -h */
break;
case OPT_HELP: /* --help or -h */
- printf("useful help messages go here\n");
- exit(0);
+ help_command(PROGRAM_NAME, PROGRAM_DESCRIPTION, long_options, help_options);
break;
case OPT_SERVERS: /* --servers or -s */
opt_servers= strdup(optarg);
break;
case OPT_SERVERS: /* --servers or -s */
opt_servers= strdup(optarg);