command line arguments ruby

F

Foreero Ivan

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
 
R

Robert Klemme

2009/1/20 Foreero Ivan said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,737
Latest member
Georgeengab

Latest Threads

Top