On Sep 30, 10:38 ¨Âí¬ ÓôåæáîÃòïããï ¼óôåæáîï®ãòï®®®Àáìéãå®éô÷òïôåº > On Thursday 30 September 2010, RichardOnRails wrote: > > > > > |Hi, > > | > > |I'm using Example:http://rubylearning.com/satishtalim/ruby_arrays.html > > |as a guide to GetoptLong usage. ¨Â çåôèíåóóáçåº > > | > > |uninitialized constant GetoptLong::OptionalArgument (NameError) > > | > > |for line 10 of the program listed below (with line 10 flagged). ¨Âáî > > |anyone point me to a working example of GetoptsLong usage? > > | > > |Thanks in Advance, > > |Richard > > | > > |# SummarizeBalances.rb > > |# K:\_Projects\Ruby\_Ruby_Apps\InvestmentSW > > |# Example:http://rubylearning.com/satishtalim/ruby_arrays.html > > | > > |require 'GetoptLong' > > | > > | ¨Âõô¢ÁòçÁÒÇÖ®êïé¬ ¢© > > | > > | ¨ÂðôÇåôïðôÌïîç®îå÷> > | ¨Â ¢æòïí¢¢æ¢ ¨ÂåôïðôÌïî纺ÏðôéïîáìÁòçõíåîôÝÌéîå ±° > > | ¨Â ¢ôô¢ ¨ÂåôïðôÌïî纺ÏðôéïîáìÁòçõíåîôÝ> > | ¨Â ¢÷ååëóßõîôé좬 ¢÷¢ ¨ÂåôïðôÌïî纺ÏðôéïîáìÁòçõíåîôÝ > > | > > | > > | Process the arguments > > | ¨Âðôó®åáãè üïðôáòçü > > | ¨Âõô¥û¥ó ½¾ ¢¥ó¢ÛïðôáòçÝ > > | ¨Â > > | ¨ÂåíßáòçÁÒÇÖ®êïé¬ ¢© > > | ¨Âõô¢Òåíáéîéîç áòçó ¥óÛòåíßáòçóÝ éæ òåíßáòçó > > As you can see from the link you posted, the constant name is > GetoptLong::OPTIONAL_ARGUMENT, not GetoptLong::OptionalArgument. However,'d > consider using OptionParser (which, like GetoptLong is included in the ruby > standard library) rather than GetoptLong, since it provides a much more ruby- > oriented interface. > > Stefano Hi Stefano, Excellent response. >> As you can see ... Admittedly, I did see the syntax in the example. What I didn't see, alas, was the precise option I wanted to use. By time I clicked my SciTE editor, thus overlaying the example, I forgot the syntax. Remembering the words was all I could muster. Sad tale :-) >> OptionParser Looks good, especially the comprehensive example. Best wishes, Richard