summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-10-01 01:52:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-10-01 01:52:32 +0000
commitb9b34059a6f7eaa63aa0b7764db6eacb77531315 (patch)
tree7426057d206790c6d49bbd4b579589e22a3f852b /ruby.c
parenteb64f5de06ff378c3efe17504a1b57df9f4985f9 (diff)
* eval.c (ruby_options), ruby.c (proc_options, process_options): not
call exit(2) directly. [ruby-dev:31912] * eval.c (ruby_run_node): deal with direct exit code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ruby.c b/ruby.c
index 126e79eb3f..784d246448 100644
--- a/ruby.c
+++ b/ruby.c
@@ -614,7 +614,8 @@ proc_options(int argc, char **argv, struct cmdline_options *opt)
case 'h':
usage(origarg.argv[0]);
- exit(0);
+ rb_exit(EXIT_SUCCESS);
+ break;
case 'l':
opt->do_line = Qtrue;
@@ -787,7 +788,7 @@ proc_options(int argc, char **argv, struct cmdline_options *opt)
ruby_yydebug = 1;
else if (strcmp("help", s) == 0) {
usage(origarg.argv[0]);
- exit(0);
+ rb_exit(EXIT_SUCCESS);
}
else {
rb_raise(rb_eRuntimeError,
@@ -873,7 +874,7 @@ process_options(int argc, char **argv, struct cmdline_options *opt)
if (opt->version) {
ruby_show_version();
- exit(0);
+ return (NODE *)Qtrue;
}
if (opt->copyright) {
ruby_show_copyright();
@@ -887,7 +888,7 @@ process_options(int argc, char **argv, struct cmdline_options *opt)
if (!opt->e_script) {
if (argc == 0) { /* no more args */
if (opt->verbose)
- return 0;
+ return (NODE *)Qtrue;
opt->script = "-";
}
else {
@@ -1311,7 +1312,6 @@ ruby_process_options(int argc, char **argv)
struct cmdline_options opt;
NODE *tree;
-
MEMZERO(&opt, opt, 1);
ruby_script(argv[0]); /* for the time being */
rb_argv0 = rb_progname;