[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

commandline options and output-"method"

Skave Rat

9/10/2008 8:41:00 PM

I've got two questions:

Is it possible to run a ruby script with options? i.e.:
foobar.rb --someoption
foobar.rb -o


secondly,
(how) is it possible to change the output of a script to a static
output, so you only update a part of it? Like the progressbar of wget,
for example.
--
Posted via http://www.ruby-....

3 Answers

Phil Cowans

9/10/2008 8:51:00 PM

0

Skave Rat wrote:
> I've got two questions:
>
> Is it possible to run a ruby script with options? i.e.:
> foobar.rb --someoption
> foobar.rb -o
>
Yes - they appear in the ARGV array, and can be parsed with one of a
number of tools, eg OptionParser which is in the standard library.

> secondly,
> (how) is it possible to change the output of a script to a static
> output, so you only update a part of it? Like the progressbar of wget,
> for example.
>

You need to output ANSI terminal control characters, which you probably
also want to do through a library - ProgressBar is a simple tool if you
actually want a progress bar, otherwise you might like to look at the
Ruby ncurses bindings for more advanced applications.

Phil

Skave Rat

9/10/2008 8:59:00 PM

0

Phil Cowans wrote:
> You need to output ANSI terminal control characters, which you probably
> also want to do through a library - ProgressBar is a simple tool if you
> actually want a progress bar, otherwise you might like to look at the
> Ruby ncurses bindings for more advanced applications.
>
> Phil

Thanks

well, its not a progressbar that I need. Do you know where I can find
some good Tutorials fur ruby ncurses?
--
Posted via http://www.ruby-....

Skave Rat

9/10/2008 10:01:00 PM

0

there is absolutely no documentation about the ncurses-ruby lib out
there. And porting C-examples to ruby doesnt really work.

Is there an other way or lib to create GUI-like terminal apps?
--
Posted via http://www.ruby-....