aboutsummaryrefslogtreecommitdiffstats
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-21 02:44:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-21 02:44:23 +0000
commit255e98f502ba56973a821a0c65c9877de3154cc7 (patch)
treec2d11cf5ed0f619fd3694ae7972fde04d8f7e023 /ruby.c
parentb471e39bd1b68e6f820fcdff5512789e56b779b0 (diff)
downloadruby-255e98f502ba56973a821a0c65c9877de3154cc7.tar.gz
ruby.c: debug options in command line
* ruby.c (debug_option): parse options in --debug command line option same as RUBY_DEBUG env. available only in the trunk. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ruby.c b/ruby.c
index 94aaef96f9..c9dd782285 100644
--- a/ruby.c
+++ b/ruby.c
@@ -856,12 +856,16 @@ disable_option(const char *str, int len, void *arg)
feature_option(str, len, arg, 0U);
}
+RUBY_EXTERN const int ruby_patchlevel;
+int ruby_env_debug_option(const char *str, int len, void *arg);
+
static void
debug_option(const char *str, int len, void *arg)
{
static const char list[] = EACH_DEBUG_FEATURES(LITERAL_NAME_ELEMENT, ", ");
#define SET_WHEN_DEBUG(bit) SET_WHEN(#bit, DEBUG_BIT(bit), str, len)
EACH_DEBUG_FEATURES(SET_WHEN_DEBUG, ;);
+ if (ruby_patchlevel < 0 && ruby_env_debug_option(str, len, 0)) return;
rb_warn("unknown argument for --debug: `%.*s'", len, str);
rb_warn("debug features are [%.*s].", (int)strlen(list), list);
}