From: Joey Gibson Date: 2003-07-19T02:11:58+09:00 Subject: Re: Usage Message for GetoptLong On Sat, 19 Jul 2003 01:05:06 +0900, "Robert Klemme" wrote: ||| def hasDescription?(optarray) ||| case optarray[-1] ||| when GetoptLong::REQUIRED_ARGUMENT, ||| GetoptLong::NO_ARGUMENT, ||| GetoptLong::OPTIONAL_ARGUMENT Why not just key off of the length of the array? If you get a three element array then you don't have a description; four elements means description. I don't like keying off those constants because more could be added, and since they are just numbers anyway, you _might_ get a false positive/negative based on the description. Probably not, I guess... Ah well. TMTOWTDI, I suppose. You could rewrite it thusly def has_description?(optarray) optarray.length == 3 end Can we get one or the other of these approaches added to the code base to make this a standard part of GetoptLong? Matz, what do you think? Joey -- Dean saor, dean saor an spiorad. Is seinn d'orain beo. http://www.joeygibson.com http://www.joeygibson.com/blog/life/Wisdom.html