diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-29 10:39:53 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-29 10:39:53 +0000 |
commit | 1eafb3dd4b8f7f7ece5a53f767de85f959d4e25e (patch) | |
tree | dbcd53ea7612ee04cd92383b5ccb7154add57955 /ruby.c | |
parent | 66fe2c0dd9f30efe785ce5f7411d9386fbcfeadc (diff) |
ruby.c: parse -W option
* ruby.c (proc_options): parse and skip '-W' option and its
argument even if ignored.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r-- | ruby.c | 26 |
1 files changed, 14 insertions, 12 deletions
@@ -888,28 +888,30 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt) goto reswitch; case 'W': - if (!opt->warning) { + { size_t numlen; int v = 2; /* -W as -W2 */ - opt->warning = 1; if (*++s) { v = scan_oct(s, 1, &numlen); if (numlen == 0) v = 1; s += numlen; } - switch (v) { - case 0: - ruby_verbose = Qnil; - break; - case 1: - ruby_verbose = Qfalse; - break; - default: - ruby_verbose = Qtrue; - break; + if (!opt->warning) { + switch (v) { + case 0: + ruby_verbose = Qnil; + break; + case 1: + ruby_verbose = Qfalse; + break; + default: + ruby_verbose = Qtrue; + break; + } } + opt->warning = 1; } goto reswitch; |