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
In Reply to: Re: [gentoo-dev] new `usex` helper by Ulrich Mueller
On Wed, Sep 14, 2011 at 02:02, Ulrich Mueller wrote:
> On Tue, 13 Sep 2011, Mike Frysinger wrote: >> usex() { use $1 && echo ${2:-yes} || echo ${3:-no} ; } > > You should omit the colons though. ${2-yes} and ${3-no} will allow for > an explicit empty string as argument, whereas the :- variants won't.
in my original use, i wanted the :- behavior. but i can see how the - behavior would be generally more flexible. -mike