Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1600559 > unrolled thread

[PATCH v5 2/7] perf tool: Add option macro OPT_CALLBACK_ARG

Started byRavi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
First post2017-03-14 16:10 +0100
Last post2017-03-14 22:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v5 2/7] perf tool: Add option macro OPT_CALLBACK_ARG Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2017-03-14 16:10 +0100
    Re: [PATCH v5 2/7] perf tool: Add option macro OPT_CALLBACK_ARG Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-14 22:10 +0100

#1600559 — [PATCH v5 2/7] perf tool: Add option macro OPT_CALLBACK_ARG

FromRavi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Date2017-03-14 16:10 +0100
Subject[PATCH v5 2/7] perf tool: Add option macro OPT_CALLBACK_ARG
Message-ID<tkWfg-1T2-31@gated-at.bofh.it>
Add an option macro that is the same as OPT_CALLBACK_OPTARG except
that the argument is not optional.

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
---
 tools/lib/subcmd/parse-options.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/lib/subcmd/parse-options.h b/tools/lib/subcmd/parse-options.h
index f054ca1..79472e0 100644
--- a/tools/lib/subcmd/parse-options.h
+++ b/tools/lib/subcmd/parse-options.h
@@ -160,6 +160,10 @@ struct option {
 	{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), \
 	  .value = (v), .argh = (a), .help = (h), .callback = (f), \
 	  .flags = PARSE_OPT_OPTARG, .data = (d) }
+#define OPT_CALLBACK_ARG(s, l, v, d, a, h, f) \
+	{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), \
+	  .value = (v), .argh = (a), .help = (h), .callback = (f), \
+	  .data = (d) }
 
 /* parse_options() will filter out the processed options and leave the
  * non-option argments in argv[].
-- 
2.9.3

[toc] | [next] | [standalone]


#1600907

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2017-03-14 22:10 +0100
Message-ID<tl1RD-5YL-1@gated-at.bofh.it>
In reply to#1600559
Em Tue, Mar 14, 2017 at 08:36:53PM +0530, Ravi Bangoria escreveu:
> Add an option macro that is the same as OPT_CALLBACK_OPTARG except
> that the argument is not optional.

Not 'perf tool:', adjusted to 'tools lib subcmd:' as this is not perf
specific at all, tools/lib/subcmd/ is by other tools, such as objtool.

- Arnaldo
 
> Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
> ---
>  tools/lib/subcmd/parse-options.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/tools/lib/subcmd/parse-options.h b/tools/lib/subcmd/parse-options.h
> index f054ca1..79472e0 100644
> --- a/tools/lib/subcmd/parse-options.h
> +++ b/tools/lib/subcmd/parse-options.h
> @@ -160,6 +160,10 @@ struct option {
>  	{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), \
>  	  .value = (v), .argh = (a), .help = (h), .callback = (f), \
>  	  .flags = PARSE_OPT_OPTARG, .data = (d) }
> +#define OPT_CALLBACK_ARG(s, l, v, d, a, h, f) \
> +	{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), \
> +	  .value = (v), .argh = (a), .help = (h), .callback = (f), \
> +	  .data = (d) }
>  
>  /* parse_options() will filter out the processed options and leave the
>   * non-option argments in argv[].
> -- 
> 2.9.3

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web