From 42bd71d0812ecd955cf65a14375ebe6a3195d979 Mon Sep 17 00:00:00 2001 From: Namhyung Kim Date: Thu, 23 Oct 2014 00:15:48 +0900 Subject: perf tools: Add support for exclusive option 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. Signed-off-by: Namhyung Kim Reviewed-by: Masami Hiramatsu Acked-by: Hemant Kumar Cc: David Ahern Cc: Hemant Kumar Cc: Ingo Molnar Cc: Jiri Olsa Cc: Masami Hiramatsu Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1413990949-13953-5-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/parse-options.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tools/perf/util/parse-options.h') diff --git a/tools/perf/util/parse-options.h b/tools/perf/util/parse-options.h index b7c80dbc7627..97b153fb4999 100644 --- a/tools/perf/util/parse-options.h +++ b/tools/perf/util/parse-options.h @@ -39,6 +39,7 @@ enum parse_opt_option_flags { PARSE_OPT_HIDDEN = 8, PARSE_OPT_LASTARG_DEFAULT = 16, PARSE_OPT_DISABLED = 32, + PARSE_OPT_EXCLUSIVE = 64, }; struct option; @@ -174,6 +175,7 @@ struct parse_opt_ctx_t { const char **out; int argc, cpidx; const char *opt; + const struct option *excl_opt; int flags; }; -- cgit v1.2.3