Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753159AbdCNVAd (ORCPT ); Tue, 14 Mar 2017 17:00:33 -0400 Received: from mail.kernel.org ([198.145.29.136]:60820 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751061AbdCNVAb (ORCPT ); Tue, 14 Mar 2017 17:00:31 -0400 Date: Tue, 14 Mar 2017 18:00:24 -0300 From: Arnaldo Carvalho de Melo To: Ravi Bangoria Cc: mingo@redhat.com, mhiramat@kernel.org, brendan.d.gregg@gmail.com, peterz@infradead.org, alexander.shishkin@linux.intel.com, wangnan0@huawei.com, jolsa@kernel.org, ak@linux.intel.com, treeze.taeung@gmail.com, mathieu.poirier@linaro.org, hekuang@huawei.com, sukadev@linux.vnet.ibm.com, ananth@in.ibm.com, naveen.n.rao@linux.vnet.ibm.com, adrian.hunter@intel.com, linux-kernel@vger.kernel.org, hemant@linux.vnet.ibm.com Subject: Re: [PATCH v5 2/7] perf tool: Add option macro OPT_CALLBACK_ARG Message-ID: <20170314210024.GD12825@kernel.org> References: <20170314150658.7065-1-ravi.bangoria@linux.vnet.ibm.com> <20170314150658.7065-3-ravi.bangoria@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170314150658.7065-3-ravi.bangoria@linux.vnet.ibm.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1235 Lines: 31 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 > --- > 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