From f17b469860dcea4186d521c1877cbd790698beeb Mon Sep 17 00:00:00 2001 From: yugui Date: Fri, 11 Feb 2011 15:03:51 +0000 Subject: [PATCH] * ruby.c (proc_options): add --gem=enabled as an alias of --enable=gems and --gem=disabled as an alias of --disable=gems. Gem named "enabled" or "disabled" has already been reserved legitimately for this purpose. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ ruby.c | 10 +++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 797c0fe76b..238af8a35b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Fri Feb 11 23:27:50 2011 Yuki Sonoda (Yugui) + + * ruby.c (proc_options): add --gem=enabled as an alias of + --enable=gems and --gem=disabled as an alias of --disable=gems. + Gem named "enabled" or "disabled" has already been reserved + legitimately for this purpose. + Fri Feb 11 23:17:04 2011 Tanaka Akira * ext/dl/cfunc.c: parenthesize macro arguments. diff --git a/ruby.c b/ruby.c index 86d779e63b..87ca6bed23 100644 --- a/ruby.c +++ b/ruby.c @@ -1072,7 +1072,15 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt) add_modules(&opt->req_list, s); } else if (is_option_with_arg("gem", Qfalse, Qtrue)) { - add_gems(&opt->req_list, s); + if (strcmp("disabled", s) == 0) { + opt->disable |= DISABLE_BIT(gems); + } + else if (strcmp("enabled", s) == 0) { + opt->disable &= ~DISABLE_BIT(gems); + } + else { + add_gems(&opt->req_list, s); + } } else if (strcmp("version", s) == 0) { if (envopt) goto noenvopt_long;