diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ruby.c | 7 |
2 files changed, 10 insertions, 3 deletions
@@ -1,3 +1,9 @@ +Thu Aug 9 18:33:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * ruby.c (proc_options): show version only once even if -v and + --verbose are given together. + http://twitter.com/d6rkaiz/status/233491797085671424 + Thu Aug 9 12:37:22 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com> * test/openssl/test_config.rb (OpenSSL#test_constants): skip this @@ -62,6 +62,7 @@ enum disable_flag_bits { #define DUMP_BIT(bit) (1U << dump_##bit) enum dump_flag_bits { dump_version, + dump_version_v, dump_copyright, dump_usage, dump_yydebug, @@ -748,7 +749,7 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt) s++; goto reswitch; } - ruby_show_version(); + opt->dump |= DUMP_BIT(version_v); opt->verbose = 1; case 'w': ruby_verbose = Qtrue; @@ -1271,9 +1272,9 @@ process_options(int argc, char **argv, struct cmdline_options *opt) if (opt->src.enc.name) rb_warning("-K is specified; it is for 1.8 compatibility and may cause odd behavior"); - if (opt->dump & DUMP_BIT(version)) { + if (opt->dump & (DUMP_BIT(version) | DUMP_BIT(version_v))) { ruby_show_version(); - return Qtrue; + if (opt->dump & DUMP_BIT(version)) return Qtrue; } if (opt->dump & DUMP_BIT(copyright)) { ruby_show_copyright(); |