From: Christian van der Leeden Date: 2004-07-13T06:49:53+09:00 Subject: OptionParser question --Apple-Mail-20--307359757 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Hi, how can I parse options with OptionParser that are not prefixed by a "-x" or "--xxx"? My script should be called like: webserver.rb e.g. webserver.rb --maintenance start or webserver.rb start There is a fixed number of commands that can be given, e.g. start/stop/restart/sync I'im thinking in the lines of (which doesn't work ...): opts.on("COMMAND", ["start", "stop", "restart", "sync"] , " tell the webserver what to do, e.g. start") { |@command| } Is there a way to instruct OptionParser to require this? Thanx Christian ----------------------------------------------- Christian van der Leeden Software Engineering --Apple-Mail-20--307359757 Content-Transfer-Encoding: quoted-printable Content-Type: text/directory; x-unix-mode=0644; name="Christian van der Leeden.vcf" Content-Disposition: attachment; filename="Christian van der Leeden.vcf" BEGIN:VCARD VERSION:3.0 N:van=20der=20Leeden;Christian;;; FN:Christian=20van=20der=20Leeden ORG:Logic=20United=20GmbH; TITLE:Software=20Engineering EMAIL;type=3DINTERNET;type=3DHOME;type=3Dpref:next2you@mac.com EMAIL;type=3DINTERNET;type=3DWORK:leeden@logicunited.com TEL;type=3DWORK;type=3Dpref:+49-89-189488-66 TEL;type=3DCELL:+49-163-3747111 item1.ADR;type=3DWORK;type=3Dpref:;;Brecherspitzstrasse=20= 8;Muenchen;;81541;Germany item1.X-ABADR:de URL:www.logicunited.com X-AIM;type=3DHOME;type=3Dpref:next2you X-ICQ;type=3DWORK;type=3Dpref:13450543 CATEGORY:Buddy,EADS END:VCARD --Apple-Mail-20--307359757--