# Commandline options and output-"method"

**URL:** <https://www.ruby-forum.com/t/commandline-options-and-output-method/148249>\
**Category:** Ruby\
**Created:** [September 10, 2008, 10:47pm UTC](https://www.ruby-forum.com/t/commandline-options-and-output-method/148249 "2008-09-10T22:47:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![skaverat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@skaverat](https://www.ruby-forum.com/u/skaverat)\
**Post date:** [September 10, 2008, 10:47pm UTC](https://www.ruby-forum.com/t/commandline-options-and-output-method/148249/1 "2008-09-10T22:47:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![skaverat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@skaverat](https://www.ruby-forum.com/u/skaverat)\
**Post date:** [September 10, 2008, 10:57pm UTC](https://www.ruby-forum.com/t/commandline-options-and-output-method/148249/2 "2008-09-10T22:57:48Z")

</div>

Skave R. 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

---

<div class="post-metadata">

**Author:** ![skaverat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@skaverat](https://www.ruby-forum.com/u/skaverat)\
**Post date:** [September 10, 2008, 11:06pm UTC](https://www.ruby-forum.com/t/commandline-options-and-output-method/148249/3 "2008-09-10T23:06:02Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![skaverat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@skaverat](https://www.ruby-forum.com/u/skaverat)\
**Post date:** [September 11, 2008, 12:07am UTC](https://www.ruby-forum.com/t/commandline-options-and-output-method/148249/4 "2008-09-11T00:07:27Z")

</div>

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?
