From: Jim Freeze Date: 2005-09-02T20:52:53+09:00 Subject: Re: [SUMMARY] Word Chains (#44) Nice write-up James. I'm sorry I didn't make a submission, but I had a drive failure over the weekend and didn't get to complete my solution. However, albeit a little late, I am posting my command line parsing solution in the hopes that others will find it as convenient as I do. require 'rubygems' require 'commandline' class App < CommandLine::Application def initialize synopsis "[-d] word1 word2" option :names => %w(--dictionary -d), :opt_description => "Alternate dictionary. Default is in /usr/share/dict/words", :arg_description => "path_to_dictionary", :opt_found => get_arg, :opt_not_found => "/usr/share/dict/words" expected_args :word1, :word2 end def main q = Quiz44.new(@option_data["--dictionary"]) puts q.find_shortest_path(@word1, @word2) end end Cheers -- Jim Freeze