From: Rupert B. <rup...@fr...> - 2008-04-20 18:57:27
|
Scott, My problem is more related to RubyCocoa : I have a RubyCocoa app called MyApp.app. I would like to be able to call this from the command-line with my own command-line argument, e.g. MyApp.app/Contents/MacOS/MyApp --myswitch When I do this, I get an error reported by ruby not recognising this switch. How can I get pass the Ruby parser, so that I can later (in my app) use the ARGV global to recognize which switch was passed to my app ? I need something like the "-s", but this only works if I tell it to load a ruby file; I just want it to find rb_main.rb and run away ... Rup Le 20 avr. 08 à 12:31, Rupert BARROW a écrit : > Thanks for the pointer. > Rup > > Le 19 avr. 08 à 04:50, Scott Thompson a écrit : > >> >> On Apr 18, 2008, at 6:39 PM, Rupert BARROW wrote: >> >>> Hi, >>> >>> Is there a useful sample showing how to receive and use command-line >>> argument in Ruby code in RubyCocoa ? >>> How do argc and argv pass the rb_main_init ? >> >> If you are using RBApplicationMain or RBApplicationInit then the >> arguments should be in the standard Ruby "ARGV" array. >> >> http://www.rubycentral.com/pickaxe/rubyworld.html >> >> Scott >> >> > |