commandline options and output-"method"

Discussion in 'Ruby' started by Skave Rat, Sep 10, 2008.

  1. Skave Rat

    Skave Rat Guest

    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/.
     
    Skave Rat, Sep 10, 2008
    #1
    1. Advertising

  2. Skave Rat

    Phil Cowans Guest

    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
     
    Phil Cowans, Sep 10, 2008
    #2
    1. Advertising

  3. Skave Rat

    Skave Rat Guest

    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/.
     
    Skave Rat, Sep 10, 2008
    #3
  4. Skave Rat

    Skave Rat Guest

    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/.
     
    Skave Rat, Sep 10, 2008
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Robert
    Replies:
    8
    Views:
    386
    Tim N. van der Leeuw
    May 22, 2006
  2. chrisber
    Replies:
    1
    Views:
    391
    chrisber
    May 2, 2008
  3. Sijo Kg
    Replies:
    1
    Views:
    107
    Justin Collins
    Jan 7, 2009
  4. Clifford Heath

    Ruby 1.9.2 commandline options

    Clifford Heath, Nov 16, 2010, in forum: Ruby
    Replies:
    5
    Views:
    114
    Clifford Heath
    Nov 19, 2010
  5. Santosh Kumar
    Replies:
    2
    Views:
    202
    Steven D'Aprano
    Sep 16, 2012
Loading...

Share This Page