new function for "list" type queries

Auke Kok sofar at foo-projects.org
Wed Jul 12 14:55:00 UTC 2006


Jon South wrote:
> Auke Kok wrote:
>> I don't like the "|" character as a separator, and I think it should be 
>> removed. Not only would strange things happen if accidentally someone sh'd a 
>> CONFIGURE file, it also isn't the standard style we've been using
>>
>> can you rewrite it so the format would become:
>>
>>  > +lquery MPM "Please select a Multi-Processing Module (MPM)." 
>> "prefork|Prefork (Default)" "worker|Worker"
>>
>> lquery MPM "Please select a Multi-Processing Module (MPM)." \
>>         "prefork" "Prefork thread model (Default)" \
>>         "worker" "Worker thread model (recommended when using NPTL threads)"
>>
>> this would also be much more readable.
>>
>> Auke
> 
> Pipes only cause problems outside quotes, but I can see your point if 
> someone commits without them (although I cant think of any module that 
> doesn't use quotes for things like this ;P). The reason I did it like 
> this is because it keeps the code shorter much simpler.
> 
> To make it work with that many arguments, you'd probably end up changing
> 
>    for TARGET ; do
> 
> to this:
> 
>    while [[ -n "$1" ]]; do
>      $VALUE=$1
 >      $DESC=$2
 >      shift;shift

VALUE=$1
DESC=$2
shift 2

:)

> and adjusting the rest accordingly. Though, i'm not sure if you'd have 
> scope issues with the $1 in the while statement.

none, and if you're paranoid, you can always use:

for (( n = 1 ; n <= $# ; n++ )); do
	ITEM=...

Auke


More information about the Lunar-dev mailing list