X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=clients%2Fmemstat.c;h=8c1bbea0e554a14883cb5c7311e428849f717baf;hb=d333fb781926d527fbe43553c1bc7351c2205312;hp=36ee343e156745baafb45034a4f4271ccb407e76;hpb=7c41f51579dc36df33ec83a743dba8cc1ddc3e3f;p=awesomized%2Flibmemcached diff --git a/clients/memstat.c b/clients/memstat.c index 36ee343e..8c1bbea0 100644 --- a/clients/memstat.c +++ b/clients/memstat.c @@ -22,6 +22,17 @@ static int opt_verbose= 0; static int opt_displayflag= 0; static char *opt_servers= NULL; +static struct option long_options[]= +{ + {"version", no_argument, NULL, OPT_VERSION}, + {"help", no_argument, NULL, OPT_HELP}, + {"verbose", no_argument, &opt_verbose, OPT_VERBOSE}, + {"debug", no_argument, &opt_verbose, OPT_DEBUG}, + {"servers", required_argument, NULL, OPT_SERVERS}, + {"flag", no_argument, &opt_displayflag, OPT_FLAG}, + {0, 0, 0, 0}, +}; + int main(int argc, char *argv[]) { unsigned int x; @@ -41,7 +52,8 @@ int main(int argc, char *argv[]) opt_servers= strdup(temp); else { - fprintf(stderr, "No Servers provided\n"); + fprintf(stderr, "No Servers provided\n\n"); + help_command(PROGRAM_NAME, PROGRAM_DESCRIPTION, long_options, 0); exit(1); } } @@ -101,17 +113,6 @@ void options_parse(int argc, char *argv[]) {0}, }; - static struct option long_options[]= - { - {"version", no_argument, NULL, OPT_VERSION}, - {"help", no_argument, NULL, OPT_HELP}, - {"verbose", no_argument, &opt_verbose, OPT_VERBOSE}, - {"debug", no_argument, &opt_verbose, OPT_DEBUG}, - {"servers", required_argument, NULL, OPT_SERVERS}, - {"flag", no_argument, &opt_displayflag, OPT_FLAG}, - {0, 0, 0, 0}, - }; - int option_index= 0; int option_rv;