perf tools: Add option macro OPT_BOOLEAN_SET
OPT_BOOLEAN_SET records whether a boolean option was set by the user. That information can be used to change the default value for the option after the options have been parsed. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1384768557-23331-4-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
4bc437964e
commit
167faf32b0
@@ -78,6 +78,8 @@ static int get_value(struct parse_opt_ctx_t *p,
|
||||
|
||||
case OPTION_BOOLEAN:
|
||||
*(bool *)opt->value = unset ? false : true;
|
||||
if (opt->set)
|
||||
*(bool *)opt->set = true;
|
||||
return 0;
|
||||
|
||||
case OPTION_INCR:
|
||||
|
||||
Reference in New Issue
Block a user