From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753088AbdCNPJe (ORCPT ); Tue, 14 Mar 2017 11:09:34 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48121 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753233AbdCNPH1 (ORCPT ); Tue, 14 Mar 2017 11:07:27 -0400 From: Ravi Bangoria To: mingo@redhat.com, acme@kernel.org, mhiramat@kernel.org Cc: 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, Ravi Bangoria Subject: [PATCH v5 2/7] perf tool: Add option macro OPT_CALLBACK_ARG Date: Tue, 14 Mar 2017 20:36:53 +0530 X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170314150658.7065-1-ravi.bangoria@linux.vnet.ibm.com> References: <20170314150658.7065-1-ravi.bangoria@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 17031415-0024-0000-0000-000003B2D673 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17031415-0025-0000-0000-0000113057D6 Message-Id: <20170314150658.7065-3-ravi.bangoria@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-03-14_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703140118 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add an option macro that is the same as OPT_CALLBACK_OPTARG except that the argument is not optional. 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