mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
ruby.c: show version only once
* ruby.c (proc_options): show version only once even if -v and --verbose are given together. http://twitter.com/d6rkaiz/status/233491797085671424 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f207f7793d
commit
0e92dc4b72
2 changed files with 10 additions and 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
|
||||
|
|
7
ruby.c
7
ruby.c
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue