From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C88C5A0562; Tue, 31 Mar 2020 17:05:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1E602322C; Tue, 31 Mar 2020 17:05:16 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 7B807FFA for ; Tue, 31 Mar 2020 17:05:14 +0200 (CEST) IronPort-SDR: oXitzzom10PqmXFh5ejHlhKaH1TdTkc00vyN/hQj0h7lahDVAp1bxuMyf9C0M+oojXlF6Y/1aQ kfsj27UlyNRg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2020 06:11:22 -0700 IronPort-SDR: nGmRQVNYoISQl69bzjQoh8tlxidHc+1P92F4OXGyZF+zQYL2VxQvLZ2E2GvWn/OJzvve17Rx9h Nbm0Nsi6oHMQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,327,1580803200"; d="scan'208";a="283986778" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga002.fm.intel.com with ESMTP; 31 Mar 2020 06:11:22 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 31 Mar 2020 06:11:22 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 31 Mar 2020 06:11:22 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.108) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 31 Mar 2020 06:11:22 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TgwYsjQ+ZjsMgyxXjM8jwEpbWBzsulDXCaz1Vws8CjxrWRUH565S2W6f36DeMArC+eU9pLSh2tagEFdIct6GPB1LV0O6oWEAd/g4yxd4FS+R9JpBZxXID0cBgZdfHY7FrcfzoFV4WH1WhmdSowRLpCeAJFZe9UUID1djs4n/vJWaf+zz7CPUlqinXcG5kdf41opsShSkCG3Lh0MN9IixtUZQLN0riQZBPyBMXvvbrSdKuuI7NI0L7HAhKVFY14r4kYHJ7dMkgBE6zT/VUGYv64dhvlbqCmd2DGn1c3nacaCSTtmBNuM1clpH3jySBGpb1WzEpJQqpeD2qCpqKqUp6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5dXM95kddvq7fvaRPXG+iTcS13EXCUE6um7+5CIlp2Q=; b=mFuijU4JlfsKpDoWjc5NA2PfLQqqSYIC4/ZUMTxLrW4f3dR9wcy5PHpF0M+5wjz5oHh7fjTzTjRGP/DHJWyTMrI853pEvF9GWVLgrpTywyR0PklJWkWK1KA9ZuWrxiXzQLN/djlOxSUH6BPZFl1flP7XB8hc+3jY8BCsWOVIGfX2GCOG/HJT/BMyLDLeAtoPWlkncXwvDNd6DGg4jTBmLB594DT4smpn/osDYh3J+vNOi1ZHHa6b5+POjNPKKNzIJcNaTPpl2dKN2D47M5qcHfkbnRNV3UDj2wYUoaZ/Iv2L9NlKjkPn1Pr8B4oj8Yq6i/PJQkldUZklALzSirn3Cg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5dXM95kddvq7fvaRPXG+iTcS13EXCUE6um7+5CIlp2Q=; b=NeQK7WZOzcXfpsmpGD9VgOfGKZvV6o/q9qwMdEF8We0Yi4hNy4jzB+AYjZBPHXhnhVfL5k9xIlxCkELgHMYYCGucJ450AlC9FzLVmdktr4SgENAO5qEryW9V8UMsJBfdJssR6KITTorIDV4wPgc2nS6B2Gv0vZWA8A6FlOfbCyw= Received: from MWHPR11MB1952.namprd11.prod.outlook.com (2603:10b6:300:111::11) by MWHPR11MB1584.namprd11.prod.outlook.com (2603:10b6:301:e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Tue, 31 Mar 2020 13:11:20 +0000 Received: from MWHPR11MB1952.namprd11.prod.outlook.com ([fe80::35d0:34de:9332:30f0]) by MWHPR11MB1952.namprd11.prod.outlook.com ([fe80::35d0:34de:9332:30f0%6]) with mapi id 15.20.2856.019; Tue, 31 Mar 2020 13:11:20 +0000 From: "Power, Ciara" To: Thomas Monjalon CC: "dev@dpdk.org" , "Yigit, Ferruh" Thread-Topic: [dpdk-dev] [PATCH 1/2] devtools: standardize script arguments Thread-Index: AQHV1e2lYZ3LYWMBKkO90LzUzUpzbqgn2EkAgDsoUMA= Date: Tue, 31 Mar 2020 13:11:20 +0000 Message-ID: References: <20200128150256.14339-1-ciara.power@intel.com> <20200128150256.14339-2-ciara.power@intel.com> <3605642.fW5hKsROvD@xps> In-Reply-To: <3605642.fW5hKsROvD@xps> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: spf=none (sender IP is ) smtp.mailfrom=ciara.power@intel.com; x-originating-ip: [37.228.227.54] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5fa515a2-c1da-49ed-e3da-08d7d575011c x-ms-traffictypediagnostic: MWHPR11MB1584: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 0359162B6D x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1952.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10019020)(366004)(107886003)(55016002)(186003)(71200400001)(86362001)(498600001)(81166006)(81156014)(6916009)(54906003)(6506007)(26005)(7696005)(66476007)(33656002)(52536014)(4326008)(9686003)(66556008)(64756008)(8936002)(8676002)(66446008)(2906002)(5660300002)(76116006)(66946007); DIR:OUT; SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: iimqv1RZM2TIll9OKw964ECTLUe927d2+k8ZhOvikdiMz9/HsOqHvM62Sokyb9Ifk5Nm35zUQpQ5HWR+0iEeNec/n038kYRG+qNrY3tf3zSx+3oxJk+hzcZ9mSUcb+n2OATfJHY6SV9aowplx+Hsk7RQJEr0xcegYlN7Rhjuvm1PyRlBZEsu5AblFoCMm8QzPB1vKNZm4F9KZVqMvwjAHJR2VgLNhln19xv87pH/Sc+Q2ooZYpH67lq0BSGbsAMXExy6GEgngyimmo9w4aZDKBpQnKE/OTedaq/oRv/Gz0S50zLn7dh73FjbQU+8hZv4yESk33iJwXqErllp1vDNWgnC40Z/WK5aOzgyc+WL3MNquRFD+FRBIwHmL9s7yNLi6/qtH3O3DvE/I1KwAeLFLtNYZCBrtZQblt/Fz1Y2dDqbSCXzSCRCnHhM6pCqOMA1 x-ms-exchange-antispam-messagedata: AxWhkF9c1mGFLR3NSh9kVG8wGOqSh4UkSPjC7Le13bjZaipW6ES63WH2Qe/zRBc3hgR9X71zu2LoKPc0MkkvAFt+kO25baRLVrsIUW/mNnLEH68eikCCXHnI9xuMtH3PMO9JTaZWOLowC7og6FNVhg== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 5fa515a2-c1da-49ed-e3da-08d7d575011c X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Mar 2020 13:11:20.1065 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vLU2K2NqACTrTfxPB9Z3wYgYdoEd01uUruVjz7JhlpXwuc16urEnt/Jms+Hdq2O8qVUItF0sPILJ29VW2x8sPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1584 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH 1/2] devtools: standardize script arguments X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Thomas, Thanks for the review, >Subject: Re: [dpdk-dev] [PATCH 1/2] devtools: standardize script arguments > >Hi, > >Thanks for improving tooling. > >28/01/2020 16:02, Ciara Power: >> range=3D${1:-origin/master..} > >If doing a real option management, range should be the remaining argument >after option parsing. The goal of this patch is to make the check-git-log and checkpatches script= s more consistent, while maintaining backward compatibility. I think the range value here should remain unchanged, so users can use the = script as they have been using it before this patch, passing range as $1. > >> +if [ "$range" =3D '--help' ] ; then >> + print_usage > >Missing "exit 0" after usage. > >> # convert -N to HEAD~N.. in order to comply with git-log-fixes.sh >> getopts -if printf -- $range | grep -q '^-[0-9]\+' ; then >> - range=3D"HEAD$(printf -- $range | sed 's,^-,~,').." >> +elif printf -- "$range" | grep -q '^-[0-9]\+' ; then >> + range=3D"HEAD$(printf -- "$range" | sed 's,^-,~,').." > >getopts won't be called if $1 starts with -N. >I think it would be cleaner to handle this in "?" case below. > Does the getopts need to be called if $1 is -N?=20 I am not sure handling this in the "?" case below would work - as far as I= =20 know if the N value is more than one character, it would be treated as=20 multiple separate characters (e.g. -123 would be treated as -1 2 3) >> +else >> + while getopts hr:n: ARG ; do >> + case $ARG in >> + n ) range=3D"HEAD~$OPTARG.." ;; >> + r ) range=3D$OPTARG ;; > >-r is not a git-log option. >Please handle it without the need for -r. > The -r option is added here to standardise the scripts - this is currently = being used in the checkpatches getops. >> + h ) print_usage ; exit 0 ;; >> + ? ) print_usage ; exit 1 ;; >> + esac >> + done >> + shift $(($OPTIND - 1)) > > Thanks, Ciara