From: Max Power Date: 2009-12-04T00:13:26+09:00 Subject: Re: Building a Ruby executable that take a command-line argument Lars Christensen wrote: > On Thu, Dec 3, 2009 at 3:49 PM, Max Power > wrote: >> My hopeful end result will be to create one executable that will do >> numerous tasks, all of which is driven by the argument sent in. �My only >> other option, as far as I know, would be to build separate executables >> for these tasks; however, that would result in dozens of executables. >> >> Thoughts/Suggestions? > > Works for me. > > C:\>type argv.rb > p ARGV > > C:\>ocra argv.rb > > C:\>argv.exe hello > ["hello"] > > Can you provide a minimal script showing the problem? > > You can also ask questions specific for ocra here: > http://rubyforge.org/forum/forum.php?forum_id=31710 Thanks for the quick response. There were two issues on my end. (1) When building the executable, I was actually building the executable as such: C:\>ocra argv.rb hello The other things I was doing was attempting to concatenate a string to the front end of the argument prior to outputting it puts "ARGUMENT: "+ARGV[0] So basically it works now and I'm an idiot :o) Thanks again for the help! -- Posted via http://www.ruby-forum.com/.