[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YS54pArzp3mKKZzM@kernel.org>
Date: Tue, 31 Aug 2021 15:44:52 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Riccardo Mancini <rickyman7@...il.com>
Cc: Ian Rogers <irogers@...gle.com>,
Namhyung Kim <namhyung@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Mark Rutland <mark.rutland@....com>,
Jiri Olsa <jolsa@...hat.com>, linux-kernel@...r.kernel.org,
linux-perf-users@...r.kernel.org
Subject: Re: [RFC PATCH v1 31/37] tools lib/subcmd: add OPT_UINTEGER_OPTARG
option type
Em Sat, Aug 21, 2021 at 11:19:37AM +0200, Riccardo Mancini escreveu:
> This patch adds OPT_UINTEGER_OPTARG, which is the same as OPT_UINTEGER,
> but also makes it possible to use the option without any value, setting
> the variable to a default value, d.
Thanks, applied, just to erode a bit the patch kit.
- Arnaldo
> Signed-off-by: Riccardo Mancini <rickyman7@...il.com>
> ---
> tools/lib/subcmd/parse-options.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/lib/subcmd/parse-options.h b/tools/lib/subcmd/parse-options.h
> index d2414144eb8c9927..41b9b942504d398e 100644
> --- a/tools/lib/subcmd/parse-options.h
> +++ b/tools/lib/subcmd/parse-options.h
> @@ -133,6 +133,7 @@ struct option {
> #define OPT_SET_PTR(s, l, v, h, p) { .type = OPTION_SET_PTR, .short_name = (s), .long_name = (l), .value = (v), .help = (h), .defval = (p) }
> #define OPT_INTEGER(s, l, v, h) { .type = OPTION_INTEGER, .short_name = (s), .long_name = (l), .value = check_vtype(v, int *), .help = (h) }
> #define OPT_UINTEGER(s, l, v, h) { .type = OPTION_UINTEGER, .short_name = (s), .long_name = (l), .value = check_vtype(v, unsigned int *), .help = (h) }
> +#define OPT_UINTEGER_OPTARG(s, l, v, d, h) { .type = OPTION_UINTEGER, .short_name = (s), .long_name = (l), .value = check_vtype(v, unsigned int *), .help = (h), .flags = PARSE_OPT_OPTARG, .defval = (intptr_t)(d) }
> #define OPT_LONG(s, l, v, h) { .type = OPTION_LONG, .short_name = (s), .long_name = (l), .value = check_vtype(v, long *), .help = (h) }
> #define OPT_ULONG(s, l, v, h) { .type = OPTION_ULONG, .short_name = (s), .long_name = (l), .value = check_vtype(v, unsigned long *), .help = (h) }
> #define OPT_U64(s, l, v, h) { .type = OPTION_U64, .short_name = (s), .long_name = (l), .value = check_vtype(v, u64 *), .help = (h) }
> --
> 2.31.1
--
Powered by blists - more mailing lists