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 18D80A0558; Sat, 22 Feb 2020 21:53:09 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2937C25B3; Sat, 22 Feb 2020 21:53:08 +0100 (CET) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by dpdk.org (Postfix) with ESMTP id 23EB31F1C for ; Sat, 22 Feb 2020 21:53:06 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 10B4B5FE; Sat, 22 Feb 2020 15:53:05 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 22 Feb 2020 15:53:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=ivNCbObLM9AeQQX5rzRhYsRCRuyJo6wgg7NawHAfXIo=; b=QBF3brxcSeqi ProTRbBslEM38rc1R0RT/1jbt37XWKcPArwSZLl0E2cpDMyojUnLTQkP+054BOcn Y60p5pfRtZzTNCdYluDJKIpKZ26nCyyYyeGAEXXpUvPSGZqXY0QwBvAdfvssveDN egKETQfm2LLFoeuj7gN2Sb6l5m28LQ4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=ivNCbObLM9AeQQX5rzRhYsRCRuyJo6wgg7NawHAfX Io=; b=VBdv0/RWdKVszPxhzbuCQjinqc/NDfqY1ldQV+GHGSfZM4hrCPjbRUy7c QyU9V8xMEu7bp6fc37nSjwpjQcnwrzpL5TpesMMAfFZfwoBlY/4NrL5/ivqTtEnQ YoCKMmmdMp3xd8wK2xoRPdfn/f1hqPlmNQ8/+pfWW4tBfNwG+RHZ0pYPi/7Sb8TA idt97Wdu3Q1Z4rvonWOFLN6JwRPG8toF3wKF9n6T02nbTQPJlraqHrskgKgkCpTR GGD9zBpDgtKyCIisR6QEDsaBtuKczvFthoBi7pVig+Khad504z5JzOSWs4ztEF/g a7iPfuZ0luT55dobA8FW04Aa6t8vQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrkeeigddugeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecukf hppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghrufhiiigvpedtnecurfgr rhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id BB823328005D; Sat, 22 Feb 2020 15:53:03 -0500 (EST) From: Thomas Monjalon To: Ciara Power Cc: dev@dpdk.org, ferruh.yigit@intel.com Date: Sat, 22 Feb 2020 21:53:02 +0100 Message-ID: <3605642.fW5hKsROvD@xps> In-Reply-To: <20200128150256.14339-2-ciara.power@intel.com> References: <20200128150256.14339-1-ciara.power@intel.com> <20200128150256.14339-2-ciara.power@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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, Thanks for improving tooling. 28/01/2020 16:02, Ciara Power: > range=${1:-origin/master..} If doing a real option management, range should be the remaining argument after option parsing. > +if [ "$range" = '--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="HEAD$(printf -- $range | sed 's,^-,~,').." > +elif printf -- "$range" | grep -q '^-[0-9]\+' ; then > + range="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. > +else > + while getopts hr:n: ARG ; do > + case $ARG in > + n ) range="HEAD~$OPTARG.." ;; > + r ) range=$OPTARG ;; -r is not a git-log option. Please handle it without the need for -r. > + h ) print_usage ; exit 0 ;; > + ? ) print_usage ; exit 1 ;; > + esac > + done > + shift $(($OPTIND - 1))