lkml.org 
[lkml]   [2017]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v5 2/7] perf tool: Add option macro OPT_CALLBACK_ARG
Date
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
\
 
 \ /
  Last update: 2017-03-14 16:11    [W:0.151 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site