[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54488C84.3040408@hitachi.com>
Date: Thu, 23 Oct 2014 14:05:08 +0900
From: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Jiri Olsa <jolsa@...hat.com>, David Ahern <dsahern@...il.com>,
LKML <linux-kernel@...r.kernel.org>,
Hemant Kumar <hemant@...ux.vnet.ibm.com>
Subject: Re: [PATCH 4/5] perf tools: Add support for exclusive option
(2014/10/23 0:15), Namhyung Kim wrote:
> Some options cannot be used at the same time. To handle such options
> add a new PARSE_OPT_EXCLUSIVE flag and show error message if more than
> one of them is used.
Looks useful for me :)
Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
I just have a comment below;
> @@ -360,19 +378,21 @@ int parse_options_step(struct parse_opt_ctx_t *ctx,
> }
>
> if (arg[1] != '-') {
> - ctx->opt = arg + 1;
> + ctx->opt = ++arg;
> if (internal_help && *ctx->opt == 'h')
> return usage_with_options_internal(usagestr, options, 0);
> switch (parse_short_opt(ctx, options)) {
> case -1:
> - return parse_options_usage(usagestr, options, arg + 1, 1);
> + return parse_options_usage(usagestr, options, arg, 1);
> case -2:
> goto unknown;
> + case -3:
> + goto exclusive;
BTW, it may be a time to define return error codes.
Thank you,
--
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@...achi.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists