On 11/4/07, Steve Long <[EMAIL PROTECTED]> wrote: > Marijn Schouten (hkBst) wrote: > > the current interface to use flags, useq, usev, use_with, use_enable, as > > defined in /usr/lib/portage/bin/ebuild.sh lacks generality. The common > > thing is testing a use flag and possibly echoing a string, but there is no > > function that implements this common behaviour. > > > > I propose that we add such a function. Proposed name for the function is > > "ifuse". > > > I like the overall API that is enabled (and that it doesn't break anything.) > > > I also propose to add the utility function "ifv" which is useful for > > writing concise and clean code. > > > This one seems a bit light-weight to me, but if it makes your life easier, > why not? > > One minor thing; -n is the default test, so: > [[ $1 ]] is the same as [[ -n $1 ]] > and: > [[ ! $1 ]] is the same as [[ -z $1 ]] > ''help test'' is very revealing, for those who haven't read it. ;-)
Code Clarity over shortcuts. Use the explicit version. -- [EMAIL PROTECTED] mailing list