Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: vapier@g.o
Subject: Re: [gentoo-dev] [PATCH eutils] Move remove_libtool_files() from autotools-utils for wider use.
Date: Thu, 31 May 2012 11:40:05
Message-Id: 20120531134001.7dfdd6d9@pomiocik.lan
In Reply to: Re: [gentoo-dev] [PATCH eutils] Move remove_libtool_files() from autotools-utils for wider use. by Mike Frysinger
On Thu, 31 May 2012 02:09:11 -0400
Mike Frysinger <vapier@g.o> 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 > > 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=1 ;; > *) die "invalid usage" ;; > esac
Just a little reverse logic in spirit of makefiles. But the case variant would be probably more readable indeed. -- Best regards, Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature