From: Justin Bailey Date: 2006-08-16T01:25:01+09:00 Subject: Re: Scripts framework ------=_Part_109286_26366545.1155659099339 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/15/06, Trans wrote: > > > benjohn@fysh.org wrote: > > I've been writing a few unix scripts recently. I'm very much feeling the > > need for a framework that will let me build scripts and not worry about > > such common functionality as: > > > > * providing parameters through the command line and config files, or > > falling back to program specified defaults. > > * getting help on command usage (perhaps via embedded rdoc). > > > > I would imagine there is a developed framework out there to do this kind > > of thing? 'commandline' and 'choice' are two gems that do what you want. 'commandline' is powerful, and based on the optparse library, but its documentation leaves a lot to be desired. The basic README gets you started but you have to deduce a lot for complex arguments. 'choice' is more constrained, and easier to use, but it doesn't work too well when things get complex. Its great for simple sets of name-value pairs, though. The developer also seems responsive to bugs and feedback. At least, he fixed the one bug I sent in :) Commandline: http://rubyforge.org/projects/optionparser/ Choice: http://rubyforge.org/projects/choice/ Justin ------=_Part_109286_26366545.1155659099339--