Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > commandline options and output-"method"

Reply
Thread Tools

commandline options and output-"method"

 
 
Skave Rat
Guest
Posts: n/a
 
      09-10-2008
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-forum.com/.

 
Reply With Quote
 
 
 
 
Phil Cowans
Guest
Posts: n/a
 
      09-10-2008
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

 
Reply With Quote
 
 
 
 
Skave Rat
Guest
Posts: n/a
 
      09-10-2008
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-forum.com/.

 
Reply With Quote
 
Skave Rat
Guest
Posts: n/a
 
      09-10-2008
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-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
want to show list of available options and arguments in my commandline utility Santosh Kumar Python 2 09-16-2012 07:29 AM
Ruby 1.9.2 commandline options Clifford Heath Ruby 5 11-19-2010 07:18 AM
difference between *options and options Sijo Kg Ruby 1 01-07-2009 05:51 AM
my module and unittest contend over commandline options... chrisber Python 1 05-02-2008 08:06 PM
Option parser question - reading options from file as well as commandline Andrew Robert Python 8 05-22-2006 07:18 PM



Advertisments