From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Sa3jZ-0001DS-A6 for garchives@archives.gentoo.org; Thu, 31 May 2012 11:40:05 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 16DEEE0793; Thu, 31 May 2012 11:39:50 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 16982E0724 for ; Thu, 31 May 2012 11:39:02 +0000 (UTC) Received: from pomiocik.lan (77-253-135-71.adsl.inetia.pl [77.253.135.71]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 248981B4035; Thu, 31 May 2012 11:38:58 +0000 (UTC) Date: Thu, 31 May 2012 13:40:01 +0200 From: =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= To: gentoo-dev@lists.gentoo.org Cc: vapier@gentoo.org Subject: Re: [gentoo-dev] [PATCH eutils] Move remove_libtool_files() from autotools-utils for wider use. Message-ID: <20120531134001.7dfdd6d9@pomiocik.lan> In-Reply-To: <201205310209.12438.vapier@gentoo.org> References: <1338191936-2091-1-git-send-email-mgorny@gentoo.org> <201205301719.50449.vapier@gentoo.org> <20120531074641.73b93222@pomiocik.lan> <201205310209.12438.vapier@gentoo.org> Organization: Gentoo X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA256; boundary="Sig_/ZbdkG4F4fXAIB5EvpPsd0rn"; protocol="application/pgp-signature" X-Archives-Salt: 6b532b84-e426-48bf-b650-0acca4afdb95 X-Archives-Hash: 1ed003886a6763748470c07a2f6e2288 --Sig_/ZbdkG4F4fXAIB5EvpPsd0rn Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, 31 May 2012 02:09:11 -0400 Mike Frysinger wrote: > yet, if you read the actual code, you'll see: > + [[ ${#} -le 1 ]] || die "Invalid number of args to > ${FUNCNAME}()" > + if [[ ${#} -eq 1 ]]; then > + ... > + fi >=20 > that means if more than 1 argument is passed, no error is thrown. The exact opposite. If more than a single argument is passed, error is thrown. > thought you were intending to parse $@ further on because of it > (hence the suggestion of updating the @USAGE), but it looks merely > like your arg parsing is incorrect and needs fixing. probably > easiest by doing: case $#:$1 in > 0:'') ;; > 1:all) removing_all=3D1 ;; > *) die "invalid usage" ;; > esac Just a little reverse logic in spirit of makefiles. But the case variant would be probably more readable indeed. --=20 Best regards, Micha=C5=82 G=C3=B3rny --Sig_/ZbdkG4F4fXAIB5EvpPsd0rn Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iJwEAQEIAAYFAk/HWJgACgkQfXuS5UK5QB2cQgQAn+slEVSEZpjc1xGMw1j7t/Z9 8BYdqtvTkeoCuZO8ochzvbOthO15rHPNQzFI9zE6M7wTQrreNK3gmbcZ6++AVFUz Dt4GSRDYX7qVkQ1+SbEmi0mCywtp4IvBdPDYWNbc66h2mjnokUG1JDAPIGmuAaW2 9nEeNFltbNFfCniTjpU= =pTYa -----END PGP SIGNATURE----- --Sig_/ZbdkG4F4fXAIB5EvpPsd0rn--