[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    Re: [gentoo-dev] [PATCH eutils] Move remove_libtool_files() from autotools-utils for wider use.
From:       Michał Górny <mgorny () gentoo ! org>
Date:       2012-05-31 11:40:01
Message-ID: 20120531134001.7dfdd6d9 () pomiocik ! lan
[Download RAW message or body]


On Thu, 31 May 2012 02:09:11 -0400
Mike Frysinger <vapier@gentoo.org> 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

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic