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: matt...@infracaninophile.co.uk Kent, CT11 9PW
signature.asc
Description: OpenPGP digital signature