read ruby's flag

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

read ruby's flag

Mohammad Khan
To read ruby's --verbose flag, I can read $VERBOSE from code,
What is the variable name to read '-W level' (warning level)?

Thanks,
Mohammad Khan

Reply | Threaded
Open this post in threaded view
|

Re: read ruby's flag

Antonio Cangiano
Mohammad Khan wrote:
> To read ruby's --verbose flag, I can read $VERBOSE from code,
> What is the variable name to read '-W level' (warning level)?

Hi Mohammad,
$-w (or $VERBOSE) will give you:
-W0 -> nil
No option or -W1 -> false
-W2 -> true

HTH
--
Antonio Cangiano
My Ruby blog: http://www.antoniocangiano.com