Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] new `usex` helper
Date: Wed, 14 Sep 2011 14:54:51
Message-Id: CAJaTeTrBFd-mbzsDe4YkKOh_=KQyfTeq5azBY8TqYeerC5KEbQ@mail.gmail.com
In Reply to: Re: [gentoo-dev] new `usex` helper by Ulrich Mueller
1 On Wed, Sep 14, 2011 at 02:02, Ulrich Mueller wrote:
2 > On Tue, 13 Sep 2011, Mike Frysinger wrote:
3 >> usex() { use $1 && echo ${2:-yes} || echo ${3:-no} ; }
4 >
5 > You should omit the colons though. ${2-yes} and ${3-no} will allow for
6 > an explicit empty string as argument, whereas the :- variants won't.
7
8 in my original use, i wanted the :- behavior. but i can see how the -
9 behavior would be generally more flexible.
10 -mike