76fdd9c6dde3e308d3bbaedf0f4a8b3c409ff76b
11 #include "client_options.h"
12 #include "utilities.h"
15 void options_parse(int argc
, char *argv
[]);
17 static int opt_verbose
;
18 static int opt_displayflag
;
19 static char *opt_servers
;
21 int main(int argc
, char *argv
[])
25 memc
= memcached_init(NULL
);
26 options_parse(argc
, argv
);
28 parse_opt_servers(memc
, opt_servers
);
30 memcached_deinit(memc
);
35 void options_parse(int argc
, char *argv
[])
37 static struct option long_options
[] =
39 {"version", no_argument
, NULL
, OPT_VERSION
},
40 {"help", no_argument
, NULL
, OPT_HELP
},
41 {"verbose", no_argument
, &opt_verbose
, OPT_VERBOSE
},
42 {"debug", no_argument
, &opt_verbose
, OPT_DEBUG
},
43 {"servers", required_argument
, NULL
, OPT_SERVERS
},
44 {"flag", no_argument
, &opt_displayflag
, OPT_FLAG
},
53 option_rv
= getopt_long(argc
, argv
, "", long_options
, &option_index
);
54 if (option_rv
== -1) break;
58 case OPT_VERSION
: /* --version */
59 printf("memcache tools, memcat, v1.0\n");
62 case OPT_HELP
: /* --help */
63 printf("useful help messages go here\n");
66 case OPT_SERVERS
: /* --servers */
70 /* getopt_long already printed an error message. */