OPTIONSng and OPTIONS_SINGLE, OPTIONS_MULTI

Baptiste Daroussin bapt at FreeBSD.org
Mon Jun 11 05:54:32 UTC 2012


On Mon, Jun 11, 2012 at 06:49:35AM +0100, Matthew Seaman wrote:
> 
> Dear all,
> 
> In the new OPTIONS framework, we have some great new constructs for
> doing really useful stuff constraining what different combinations of
> options may be selected.
> 
> One of these is OPTIONS_SINGLE which implements a 'radio button'
> permitting the choice of 1 item out of N options.  Well, actually, it
> allows choosing 1 out of N in its generic form.  Eg.
> 
> OPTIONS_SINGLE=	EXAMPLE
> OPTIONS_SINGLE_EXAMPLE=	FOO BAR BAZ BLURFL
> 
> (permits at exactly one out of FOO BAR BAZ BLURFL to be selected)
> 
> Now, supposing the requirement is that 'at most one of those options'
> should be selected.  Currently that is done like this:
> 
> OPTIONS_DEFINE= EXAMPLE
> OPTIONS_SINGLE=	EXAMPLE
> OPTIONS_SINGLE_EXAMPLE=	FOO BAR BAZ BLURFL
> 
> (requires at most one of FOO BAR BAZ BLURFL to be selected)
> 
> I find this unsatisfactory, partly for aesthetic reasons and partly
> because it doesn't make much sense to me.  Why should adding a normal
> on/off option with the same name as the SINGLE group mean you can choose
> either zero or one of these?  It might work if the way options were
> presented to the user was more sophisticated than dialog(1), so you
> could grey-out the SINGLE options when the controlling DEFINE is turned
> off, but dialog doesn't do that.
> 
> Surely it is more sensible to say that OPTIONS_SINGLE is strictly
> 'choose one from these options.'  Then you can implement 'zero or one of
> these options' by:
> 
> OPTIONS_SINGLE= EXAMPLE
> OPTIONS_SINGLE_EXAMPLE=	FOO BAR BAZ BLURFL NONE_OF_THE_ABOVE
> 
> Similar arguments apply to OPTIONS_MULTI.
> 
> OPTIONS_MULTI= EXAMPLE2
> OPTIONS_MULTI_EXAMPLE2= QUX QUUX QUUUX
> 
> means 'choose at one or more out of QUX QUUX QUUUX'  You can change that
> to mean 'choose any number out of QUX QUUX QUUUX' by:
> 
> OPTIONS_DEFINE= EXAMPLE2
> OPTIONS_MULTI= EXAMPLE2
> OPTIONS_MULTI_EXAMPLE2= QUX QUUX QUUUX
> 
> However, this is syntactically identical to just using normal on/off
> options with no constraints between them:
> 
> OPTIONS_DEFINE= QUX QUUX QUUUX
> 
> so that's just redundant.
> 
> What do people think?
> 
> 	Cheers,
> 
> 	Matthew
> 
> 
> -- 
> Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
>                                                   Flat 3
> PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
> JID: matthew at infracaninophile.co.uk               Kent, CT11 9PW
> 
> 

I 100% agree on that, it should be quite easy to do just needs 2 new names :)

And a patch we shouldn't be complicated (while writting the patch be careful
than some ports are already using SINGLE the aesthetic way and need to be
patched at the same time.

regards,
Bapt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20120611/d011b212/attachment.pgp


More information about the freebsd-ports mailing list