Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jun 2012 06:49:35 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        freebsd-ports <freebsd-ports@FreeBSD.org>
Subject:   OPTIONSng and OPTIONS_SINGLE, OPTIONS_MULTI
Message-ID:  <4FD586EF.20100@infracaninophile.co.uk>

next in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigB9DFADEE73D7E90DF02164B3
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable


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=3D	EXAMPLE
OPTIONS_SINGLE_EXAMPLE=3D	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=3D EXAMPLE
OPTIONS_SINGLE=3D	EXAMPLE
OPTIONS_SINGLE_EXAMPLE=3D	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=3D EXAMPLE
OPTIONS_SINGLE_EXAMPLE=3D	FOO BAR BAZ BLURFL NONE_OF_THE_ABOVE

Similar arguments apply to OPTIONS_MULTI.

OPTIONS_MULTI=3D EXAMPLE2
OPTIONS_MULTI_EXAMPLE2=3D 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=3D EXAMPLE2
OPTIONS_MULTI=3D EXAMPLE2
OPTIONS_MULTI_EXAMPLE2=3D QUX QUUX QUUUX

However, this is syntactically identical to just using normal on/off
options with no constraints between them:

OPTIONS_DEFINE=3D QUX QUUX QUUUX

so that's just redundant.

What do people think?

	Cheers,

	Matthew


--=20
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: matthew@infracaninophile.co.uk               Kent, CT11 9PW



--------------enigB9DFADEE73D7E90DF02164B3
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/VhvYACgkQ8Mjk52CukIxzWACgjuXRJ/vDd7/pIJsi6eLc7ujK
6rcAn02sCV4qVkcml5Q0vpWxjONAb1eW
=OUIW
-----END PGP SIGNATURE-----

--------------enigB9DFADEE73D7E90DF02164B3--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FD586EF.20100>