Forum: Ruby command line arguments ruby

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Foreero I. (Guest)
on 2009-01-20 18:15
 argumentos en linea de comando
Posted by Foreero I. (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
Robert K. (Guest)
on 2009-01-21 10:13
(Received via mailing list)
2009/1/20 Foreero I. <removed_email_address@domain.invalid>:
> 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
This topic is locked and can not be replied to.