Skip to Content.
Sympa Menu

sm-discuss - [SM-Discuss] Idea for improvement of config_query_multi

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: flux <flux AT sourcemage.org>
  • To: SM-Discuss <sm-discuss AT lists.ibiblio.org>
  • Subject: [SM-Discuss] Idea for improvement of config_query_multi
  • Date: Thu, 3 Jun 2010 09:10:37 +0900

I had an idea about a way to add optional comment "fields" to
config_query_multi choice selection. I'll reference an end-user example
first.

Current implementation:
Which mmworp would you like?
[0] secret
[1] foo
[2] bar
[3] blarg
You can select multiple choices by simply entering the proper numbers
and/or chars.
Select your choices? [ 0]

Idea of new implementation:
Which mmworp would you like?
[0] secret (something you're not supposed to know)
[1] foo (the standard)
[2] bar (hmmm.... interesting...)
[3] blarg (NOT WANT)
You can select multiple choices by simply entering the proper numbers
and/or chars.
Select your choices? [ 0]

The ability to put arbitrary text after a choice will greatly enable a
user to know what they are choosing without having to expend too much
effort in looking it up (at least if they still need to look it up,
they'll have a better idea of where to look).

I grepped over the grimoire (only the main grimoire) and found no
instances of anything other than bare words for the choices. If an array
item is properly quoted, it can contain spaces (and of course other
characters), so I thought that encoding the new way as follows might
work well for us:

config_query_multi WACKY_OPTIONS "Which mworp would you like?" \
"secret (something you're not supposed to know)"
"foo (the standard)"
"bar (hmm.... interesting...)"
"blarg (NOT WANT)"

We could then use the parentheses as "field delimiters", such that when
populating WACKY_OPTIONS with the selected choices we use a simple regex
to strip any optional comments, leaving only the bare word in the
variable for the script to use.

If this seems like a good idea and people can (somewhat?) agree on
parentheses as good delimiters, then I'll hack this up and submit it.

I decided to post here first rather than bugzilla because I figured this
would get the most readership/review, and the change would also require
updates to the grimoire spellwriting documentation in addition to the
actual real_config_query_multi function.

--
Justin "flux_control" Boffemmyer
Cauldron wizard and general mage
Source Mage GNU/Linux
http://www.sourcemage.org

Attachment: pgpE4MMdoYTze.pgp
Description: PGP signature




Archive powered by MHonArc 2.6.24.

Top of Page