From ruby-talk-admin@ruby-lang.org Fri Dec 16 00:00:40 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 jBFF0eZk021894; Fri, 16 Dec 2005 00:00:40 +0900 Received: from funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id F1CBE597C; Fri, 16 Dec 2005 00:00:40 +0900 (JST) Received: from localhost (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id ACEBBF04898; Fri, 16 Dec 2005 00:00:44 +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 75AE8F04897; Fri, 16 Dec 2005 00:00:43 +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 155CB630025; Fri, 16 Dec 2005 00:00:46 +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 A603E33F0D; Fri, 16 Dec 2005 00:00:39 +0900 (JST) Received: from localhost (beryllium.ruby-lang.org [127.0.0.1]) by beryllium.ruby-lang.org (Postfix) with ESMTP id 9F31D33F1C for ; Fri, 16 Dec 2005 00:00:28 +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 06530-03 for ; Fri, 16 Dec 2005 00:00:28 +0900 (JST) Received: from servalys.nl (ip545436d5.speed.planet.nl [84.84.54.213]) by beryllium.ruby-lang.org (Postfix) with ESMTP id CE5CD33F0D for ; Fri, 16 Dec 2005 00:00:27 +0900 (JST) Received: from servalys.nl (localhost [127.0.0.1]) by servalys.nl (8.13.1/8.13.1/SuSE Linux 0.7) with ESMTP id jBFF0HZ5012404 for ; Thu, 15 Dec 2005 16:00:19 +0100 Received: from localhost (wybo@localhost) by servalys.nl (8.13.1/8.13.1/Submit) with ESMTP id jBFF0G5O012401 for ; Thu, 15 Dec 2005 16:00:16 +0100 Delivered-To: ruby-talk@ruby-lang.org Date: Fri, 16 Dec 2005 00:00:29 +0900 Posted: Thu, 15 Dec 2005 16:00:16 +0100 (CET) From: Wybo Dekker Reply-To: ruby-talk@ruby-lang.org Subject: Re: GetoptLong example To: ruby-talk@ruby-lang.org (ruby-talk ML) Message-Id: In-Reply-To: <200512150847.55896.slitt@earthlink.net> References: <200512141939.34072.slitt@earthlink.net> <5cd596d60512150432y74e311c8pf90399b429a443e2@mail.gmail.com> <200512150847.55896.slitt@earthlink.net> X-ML-Name: ruby-talk X-Mail-Count: 43 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= X-Original-To: ruby-talk@ruby-lang.org 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=-6.1 required=7.0 tests=AWL,BAYES_00, CONTENT_TYPE_PRESENT,RCVDFRMLOCALIP autolearn=ham version=3.0.3 Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk Lines: 21 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 Thu, 15 Dec 2005, Steve Litt wrote: > 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. http://www.ruby-doc.org/stdlib/libdoc/optparse/rdoc/classes/OptionParser.html is good, although I don't like the use of ostruct. For a cleaner, yet extensive, construction see http://www.servalys.nl/scripts/mk with its rdoc at http://www.servalys.nl/scripts/doc/files/mk.html -- Wybo