From ruby-talk-admin@ruby-lang.org Thu Dec 15 22:47:54 2005 Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (8.12.3/8.12.3/Debian-6.6) with ESMTP id jBFDlsZk019972; Thu, 15 Dec 2005 22:47:54 +0900 Received: from funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 781975D00; Thu, 15 Dec 2005 22:47:55 +0900 (JST) Received: from localhost (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 03326F04850; Thu, 15 Dec 2005 22:47:59 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id A7D65F0484A; Thu, 15 Dec 2005 22:47:57 +0900 (JST) Received: from beryllium.ruby-lang.org (beryllium.ruby-lang.org [210.163.138.100]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 23C96630029; Thu, 15 Dec 2005 22:47:55 +0900 (JST) Received: from beryllium.ruby-lang.org (beryllium.ruby-lang.org [127.0.0.1]) by beryllium.ruby-lang.org (Postfix) with ESMTP id DD01D33E55; Thu, 15 Dec 2005 22:47:50 +0900 (JST) Received: from localhost (beryllium.ruby-lang.org [127.0.0.1]) by beryllium.ruby-lang.org (Postfix) with ESMTP id D39B933ECD for ; Thu, 15 Dec 2005 22:47:41 +0900 (JST) Received: from beryllium.ruby-lang.org ([127.0.0.1]) by localhost (beryllium.ruby-lang.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 27261-04 for ; Thu, 15 Dec 2005 22:47:41 +0900 (JST) Received: from pop-knobcone.atl.sa.earthlink.net (pop-knobcone.atl.sa.earthlink.net [207.69.195.64]) by beryllium.ruby-lang.org (Postfix) with ESMTP id 7E77D33D9C for ; Thu, 15 Dec 2005 22:47:41 +0900 (JST) Received: from dialup-4.238.19.83.dial1.orlando1.level3.net ([4.238.19.83] helo=mydesk.domain.cxm) by pop-knobcone.atl.sa.earthlink.net with esmtp (Exim 3.36 #10) id 1EmtSA-0000dk-00 for ruby-talk@ruby-lang.org; Thu, 15 Dec 2005 08:47:36 -0500 Delivered-To: ruby-talk@ruby-lang.org Date: Thu, 15 Dec 2005 22:47:42 +0900 Posted: Thu, 15 Dec 2005 08:47:55 -0500 From: Steve Litt Reply-To: ruby-talk@ruby-lang.org Subject: Re: GetoptLong example To: ruby-talk@ruby-lang.org (ruby-talk ML) Message-Id: <200512150847.55896.slitt@earthlink.net> In-Reply-To: <5cd596d60512150432y74e311c8pf90399b429a443e2@mail.gmail.com> References: <200512141939.34072.slitt@earthlink.net> <5cd596d60512150432y74e311c8pf90399b429a443e2@mail.gmail.com> X-ML-Name: ruby-talk X-Mail-Count: 28 X-MLServer: fml [fml 4.0.3 release (20011202/4.0.3)]; post only (only members can post) X-ML-Info: If you have a question, send e-mail with the body "help" (without quotes) to the address ruby-talk-ctl@ruby-lang.org; help= User-Agent: KMail/1.6.1 X-Original-To: ruby-talk@ruby-lang.org Organization: Troubleshooters.com Content-Disposition: inline X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ruby-lang.org X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on beryllium.ruby-lang.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=7.0 tests=AWL,BAYES_00,BLARS00, BLARS_SPAM00,CONTENT_TYPE_PRESENT,RCVDFRMLOCALIP,RCVD_IN_BLARS, RCVD_IN_BLARS_HOOPS,RCVD_IN_BLARS_SPAM autolearn=ham version=3.0.3 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Precedence: bulk Lines: 45 List-Id: ruby-talk.ruby-lang.org List-Software: fml [fml 4.0.3 release (20011202/4.0.3)] List-Post: List-Owner: List-Help: List-Unsubscribe: X-Virus-Scanned: by AMaViS snapshot-20020531 On Thursday 15 December 2005 07:32 am, Jim Freeze wrote: > On 12/14/05, Nick Sieger wrote: > > On 12/14/05, Steve Litt wrote: > > > Hi all, > > > > > > Anyone have a short and easy GetoptLong example in Ruby? It's > > > not object oriented in Perl or C, so I'm in unfamiliar > > > territory. > > Have you tried OptionParser? It is fully OO and integrated with > Application. > > Yes, that was the sound of my own horn. :) > > I know CommandLine cannot solve everyones needs, but I would be > interested to hear about it if it doesn't meet your needs. Maybe > there is something I can change or add to the library. > > My nefarious global take over plans are to see CommandLine - > which has a Ruby flavor - be put in the stdlib and surplant the > existing optparse and getoptlong parsers which use aging > methodologies. Hi Jim, I came across OptionParser. I tried reading the documentation, but I saw no simple proof of concept to get me started. I therefore opted for GetoptLong. At least it's not a total stranger, I've used it in C and Perl. Perhaps I just came across the wrong documentation. I'd like to have the OptionParser documentation contain a proof of concept, and a couple more examples that follow logically, without skipping steps. Thanks SteveT Steve Litt http://www.troubleshooters.com slitt@troubleshooters.com