command line arguments ruby

Discussion in 'Ruby' started by Foreero Ivan, Jan 20, 2009.

  1. Foreero Ivan

    Foreero Ivan Guest

    argumentos en linea de comando
    Posted by Foreero Ivan (ivmafo)
    on 20.01.2009 17:02

    Hola, me gustaria saber si existe alguna forma de generar mis propios
    argumentos en una linea de comando . Algo asi como como se usa el ARGV:

    $ ruby miscript.rb --miargumento1=1 --miargumento2=2 ....

    para poder usar las variables "miargumentoX" dentro de mi script ruby

    Gracias de antemano....


    Sorry for my poor english....
    Iwould like to know if there is any way to create my own command line
    arguments. like ARGV

    something like this:

    $ ruby myscript.rb --myargument1=1 --myargument2=2 ...

    and use the "myargumentX" innto my script ruby
    --
    Posted via http://www.ruby-forum.com/.
     
    Foreero Ivan, Jan 20, 2009
    #1
    1. Advertising

  2. 2009/1/20 Foreero Ivan <>:
    > Sorry for my poor english....
    > Iwould like to know if there is any way to create my own command line
    > arguments. like ARGV
    >
    > something like this:
    >
    > $ ruby myscript.rb --myargument1=1 --myargument2=2 ...
    >
    > and use the "myargumentX" innto my script ruby


    You probably rather want to know how to *parse* command line
    arguments, don't you? In that case please have a look at
    OptionParser.

    Kind regards

    robert

    --
    remember.guy do |as, often| as.you_can - without end
     
    Robert Klemme, Jan 21, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Kay
    Replies:
    1
    Views:
    496
    J├╝rgen Exner
    May 18, 2004
  2. Replies:
    4
    Views:
    1,746
    Terry Hancock
    Apr 23, 2005
  3. Swati Sharma
    Replies:
    5
    Views:
    510
    Charles Oliver Nutter
    Apr 7, 2008
  4. Jayson Williams
    Replies:
    28
    Views:
    360
    Mohit Sindhwani
    Nov 30, 2008
  5. Zhan Deaux
    Replies:
    7
    Views:
    177
    Zhan Deaux
    Dec 9, 2010
Loading...

Share This Page