Define a read-only global variable $-W
--------------------------------------

                 Key: JRUBY-6241
                 URL: https://jira.codehaus.org/browse/JRUBY-6241
             Project: JRuby
          Issue Type: Improvement
          Components: Core Classes/Modules
            Reporter: Hiro Asari


{{$-W}} corresponds to the warning level set forth by the {{-W}} flag.

The behavior of this variable is rather strange. If {{-W}} is not given, the 
value is 1:
{noformat}
$ ruby1.9 -e 'p $-W'
1
{noformat}

But if you give any of {{-v}}, {{-w}} or {{-W}} (without the argument), the 
value is 2:
{noformat}
$ ruby1.9 -v -e 'p $-W'
ruby 2.0.0dev (2011-11-21 trunk 33804) [x86_64-darwin11.2.0]
2
$ ruby1.9 -W -e 'p $-W'
2
$ ruby1.9 -w -e 'p $-W'
2
{noformat}

If you pass an argument to {{-W}}, that value is respected:
{noformat}
$ ruby1.9 -W0 -e 'p $-W'
0
$ ruby1.9 -W1 -e 'p $-W'
1
$ ruby1.9 -W2 -e 'p $-W'
2
{noformat}

I am not entirely sure how this variable is supposed to influence the warning 
output, however.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to