optparse, needless argument, mac os x intel

Discussion in 'Ruby' started by Aaron Smith, Mar 12, 2007.

  1. Aaron Smith

    Aaron Smith Guest

    I've just started using optparse. I'm hitting this needless argument
    error when one of my commandline args excepts strings.. I've looked
    around on google seeing that this was a bug that was fixed at some
    point. How can I get around it?

    thanks..

    --
    Posted via http://www.ruby-forum.com/.
     
    Aaron Smith, Mar 12, 2007
    #1
    1. Advertising

  2. Aaron Smith

    Guest

    On Mon, 12 Mar 2007, Aaron Smith wrote:

    > I've just started using optparse. I'm hitting this needless argument
    > error when one of my commandline args excepts strings.. I've looked
    > around on google seeing that this was a bug that was fixed at some
    > point. How can I get around it?


    it means that you defined are argument like this

    '--foo'

    but are giving it like this on command line

    a.rb --foo=value

    if you want an option to take values use

    '--foo=value'
    '--foo=this_can_be_anyword'

    regards.

    -a
    --
    be kind whenever possible... it is always possible.
    - the dalai lama
     
    , Mar 12, 2007
    #2
    1. Advertising

  3. Aaron Smith

    Aaron Smith Guest

    a.rb --foo=value
    >
    > if you want an option to take values use
    >
    > '--foo=value'
    > '--foo=this_can_be_anyword'
    >
    > regards.
    >
    > -a


    cool thanks.
    -a

    --
    Posted via http://www.ruby-forum.com/.
     
    Aaron Smith, Mar 12, 2007
    #3
    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. Joona I Palaste

    Needless casts?

    Joona I Palaste, Apr 24, 2004, in forum: Java
    Replies:
    15
    Views:
    700
    Icemerth
    Apr 25, 2004
  2. James Stroud

    Needless copying in iterations?

    James Stroud, Sep 15, 2007, in forum: Python
    Replies:
    22
    Views:
    650
    =?ISO-8859-1?Q?BJ=F6rn_Lindqvist?=
    Sep 17, 2007
  3. whatnext
    Replies:
    9
    Views:
    436
  4. Kazik�
    Replies:
    4
    Views:
    1,365
    Jonathan Lee
    Jul 6, 2009
  5. Jukka Lahtinen
    Replies:
    1
    Views:
    936
    Jukka Lahtinen
    Feb 24, 2011
Loading...

Share This Page