From a8efa12d2d90c3777f3c33347fe002884be1185d Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Fri, 23 Jul 2010 09:28:48 -0700 Subject: [PATCH] Added --args to memstat --- clients/client_options.h | 1 + clients/memstat.c | 7 ++++++- clients/utilities.c | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/clients/client_options.h b/clients/client_options.h index b0111707..70329051 100644 --- a/clients/client_options.h +++ b/clients/client_options.h @@ -38,6 +38,7 @@ typedef enum { OPT_UDP, OPT_USERNAME, OPT_PASSWD, + OPT_STAT_ARGS, OPT_FILE= 'f' } memcached_options; diff --git a/clients/memstat.c b/clients/memstat.c index 652421bc..e3e4e901 100644 --- a/clients/memstat.c +++ b/clients/memstat.c @@ -41,10 +41,12 @@ static int opt_verbose= 0; static int opt_displayflag= 0; static int opt_analyze= 0; static char *opt_servers= NULL; +static char *stat_args= NULL; static char *analyze_mode= NULL; static struct option long_options[]= { + {(OPTIONSTRING)"args", required_argument, NULL, OPT_STAT_ARGS}, {(OPTIONSTRING)"version", no_argument, NULL, OPT_VERSION}, {(OPTIONSTRING)"help", no_argument, NULL, OPT_HELP}, {(OPTIONSTRING)"verbose", no_argument, &opt_verbose, OPT_VERBOSE}, @@ -126,7 +128,7 @@ int main(int argc, char *argv[]) } else { - rc= memcached_stat_execute(memc, NULL, stat_printer, NULL); + rc= memcached_stat_execute(memc, stat_args, stat_printer, NULL); } free(opt_servers); @@ -332,6 +334,9 @@ static void options_parse(int argc, char *argv[]) case OPT_SERVERS: /* --servers or -s */ opt_servers= strdup(optarg); break; + case OPT_STAT_ARGS: + stat_args= strdup(optarg); + break; case OPT_ANALYZE: /* --analyze or -a */ opt_analyze= OPT_ANALYZE; analyze_mode= (optarg) ? strdup(optarg) : NULL; diff --git a/clients/utilities.c b/clients/utilities.c index de2bdf44..b51665a6 100644 --- a/clients/utilities.c +++ b/clients/utilities.c @@ -61,6 +61,7 @@ static const char *lookup_help(memcached_options option) case OPT_USERNAME: return "Username to use for SASL authentication"; case OPT_PASSWD: return "Password to use for SASL authentication"; case OPT_FILE: return "Path to file in which to save result"; + case OPT_STAT_ARGS: return "Argument for statistics"; default: WATCHPOINT_ASSERT(0); }; -- 2.30.2