From pierre.lesaffre at lra.ens.fr Thu Jan 8 09:10:32 2009 From: pierre.lesaffre at lra.ens.fr (Pierre Lesaffre) Date: Thu, 8 Jan 2009 15:10:32 +0100 (CET) Subject: [Tioga-users] Command line arguments with tioga ? Message-ID: Hello there, Is there currently any way to pass command line arguments to the ruby code that makes the figure ? For example, say I want to specify the color of the graph produced by test.rb from the command line. I would like to write something like tioga test.rb -ARGV=Green and be able to access to my arguments ['Green'] via the array ARGV in the code test.rb If not, would that be possible to implement in some way ? Cheers and thanks a lot for your wonderful work, Pierre. From nomo17k at gmail.com Thu Jan 8 17:24:49 2009 From: nomo17k at gmail.com (Taro Sato) Date: Thu, 8 Jan 2009 14:24:49 -0800 Subject: [Tioga-users] Command line arguments with tioga ? In-Reply-To: References: Message-ID: Pierre -- If you wish to use Tioga with an option to change the controls from the command line, you should try Ctioga: http://sciyag.rubyforge.org/ctioga/ Otherwise, I think you need to code up the routine to parse the command-line arguments and then setting Tioga properties in test.rb yourself. On Thu, Jan 8, 2009 at 6:10 AM, Pierre Lesaffre wrote: > > Hello there, > > Is there currently any way to pass command line arguments to the ruby > code that makes the figure ? > For example, say I want to specify the color of the graph > produced by test.rb from the command line. I would like to write > something like > > tioga test.rb -ARGV=Green > > and be able to access to my arguments ['Green'] via the array ARGV in the > code test.rb > > If not, would that be possible to implement in some way ? > > Cheers and thanks a lot for your wonderful work, > > Pierre. > > > _______________________________________________ > Tioga-users mailing list > Tioga-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/tioga-users > From fourmond at gmail.com Tue Jan 20 15:06:46 2009 From: fourmond at gmail.com (Vincent Fourmond) Date: Tue, 20 Jan 2009 21:06:46 +0100 Subject: [Tioga-users] Command line arguments with tioga ? In-Reply-To: References: Message-ID: <49762ED6.1090306@gmail.com> Hello ! Pierre Lesaffre wrote: > Is there currently any way to pass command line arguments to the ruby > code that makes the figure ? > For example, say I want to specify the color of the graph > produced by test.rb from the command line. I would like to write > something like > > tioga test.rb -ARGV=Green > > and be able to access to my arguments ['Green'] via the array ARGV in the > code test.rb The ARGV array already contains the whole command-line; see the effect of p ARGV from within the init function of samples/figures/figures.rb ~/tioga/samples/figures tioga figures.rb -l loading /home/vincent/tioga/samples/figures/figures.rb ["figures.rb", "-l"] ... I don't know how much parsing you need, but in principle it should not be too difficult to get what you want. I most agree with Taro that if you need command-line capacities, you might want to give a try to ctioga -- I'm open to (nearly) all suggestions ! Vincent -- Donkey: No one told me I had the right to remain silent ! Shrek: You *have* the right to remain silent. What you lack is the capacity. -- Shrek 2 Vincent, listening to Strawberry Fields Forever (The Beatles)