projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Files are generated with each run, no reason to save them.
[m6w6/libmemcached]
/
src
/
memcat.c
diff --git
a/src/memcat.c
b/src/memcat.c
index 81c0a85d6167c40e0cc973a21be9d578f36a34d9..bb00ca66d494341cbbfdd6a6d37c5ba5fb3676cc 100644
(file)
--- a/
src/memcat.c
+++ b/
src/memcat.c
@@
-6,6
+6,9
@@
#include "client_options.h"
#include "utilities.h"
#include "client_options.h"
#include "utilities.h"
+#define PROGRAM_NAME "memcat"
+#define PROGRAM_DESCRIPTION "Cat a set of key values to stdout."
+
/* Prototypes */
void options_parse(int argc, char *argv[]);
/* Prototypes */
void options_parse(int argc, char *argv[]);
@@
-28,7
+31,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);
@@
-63,7
+66,7
@@
int main(int argc, char *argv[])
optind++;
}
optind++;
}
- memcached_
deinit
(memc);
+ memcached_
free
(memc);
free(opt_servers);
free(opt_servers);
@@
-76,6
+79,11
@@
void options_parse(int argc, char *argv[])
int option_index= 0;
int option_rv;
int option_index= 0;
int option_rv;
+ 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},
@@
-102,12
+110,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, memcat, 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);