commandline options and output-"method"

S

Skave Rat

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.
 
P

Phil Cowans

Skave said:
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
 
S

Skave Rat

Phil said:
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?
 
S

Skave Rat

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?
 

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

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top