Not Passing On Command Line Arguments

Discussion in 'Ruby' started by Dylan, Jul 23, 2009.

  1. Dylan

    Dylan Guest

    Hey there! I have a question about passing command line arguments. I
    have a list of arguments I'd like to use alongside a couple built in
    to Test::Case. However, I keep getting an "invalid argument" error
    every time. Is there a way to handle my command line arguments and
    remove them from the array that gets passed to Test::Case or change
    how Test::Case handles arguments? I've tried writing my own
    OptionsParser instance in my code, as well as editing autorunner.rb
    (where OptionsParser is used in Test::Case) and adding my arguments
    there ( o.on('-c', '--cleanup', "Clean up stuff"){puts
    "CLEANUPPP!";exit} ), but even if I try to change the arguments that
    are already there (Changing the help text, for example), nothing seems
    to show up any different. Thanks!

    -Dylan
     
    Dylan, Jul 23, 2009
    #1
    1. Advertising

  2. Dylan

    Dylan Guest

    On Jul 23, 10:12 am, Dylan <> wrote:
    > Hey there! I have a question about passing command line arguments. I
    > have a list of arguments I'd like to use alongside a couple built in
    > to Test::Case. However, I keep getting an "invalid argument" error
    > every time. Is there a way to handle my command line arguments and
    > remove them from the array that gets passed to Test::Case or change
    > how Test::Case handles arguments? I've tried writing my own
    > OptionsParser instance in my code, as well as editing autorunner.rb
    > (where OptionsParser is used in Test::Case) and adding my arguments
    > there ( o.on('-c', '--cleanup', "Clean up stuff"){puts
    > "CLEANUPPP!";exit} ), but even if I try to change the arguments that
    > are already there (Changing the help text, for example), nothing seems
    > to show up any different. Thanks!
    >
    > -Dylan


    Also, for some reason some arguments I add (by simply adding if
    (ARGV.include? "-cleanup") ) work fine, but gives an warning:
    Deprecated option (--console). Thanks!

    -Dylan
     
    Dylan, Jul 27, 2009
    #2
    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. Replies:
    4
    Views:
    1,716
    Terry Hancock
    Apr 23, 2005
  2. =?iso-8859-1?q?Luis_M._Gonz=E1lez?=

    Passing arguments to a command line from a python script

    =?iso-8859-1?q?Luis_M._Gonz=E1lez?=, Mar 19, 2007, in forum: Python
    Replies:
    6
    Views:
    2,680
    =?iso-8859-1?q?Luis_M._Gonz=E1lez?=
    Mar 20, 2007
  3. jimgardener
    Replies:
    1
    Views:
    5,328
    Donkey Hottie
    Oct 20, 2008
  4. mcanjo
    Replies:
    11
    Views:
    526
    Bror Johansson
    Apr 6, 2010
  5. Swati Sharma
    Replies:
    5
    Views:
    485
    Charles Oliver Nutter
    Apr 7, 2008
Loading...

Share This Page