From: Motohiro KOSAKI Date: 2011-12-08T20:29:53+09:00 Subject: [ruby-dev:44952] [ruby-trunk - Bug #5728] SystemExit.new(bool, message) Issue #5728 has been updated by Motohiro KOSAKI. > I think SystemExit.new should accept a bool. We have two choice and both are a lot of confusable. 1) true => EXIT_SUCCESS, false => EXIT_FAILURE People may dislike it becuase true mapped 0 and false mapped 1. 2) true => EXIT_FAILURE, false => EXIT_SUCCESS People also may dislike it. Because true usually isn't used for failure. As far as EXIT_SUCCESS==0, I doubt we can make natural conversion. ---------------------------------------- Bug #5728: SystemExit.new(bool, message) http://redmine.ruby-lang.org/issues/5728 Author: Akira Tanaka Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: ruby 2.0.0dev (2011-12-08 trunk 33981) [x86_64-linux] I found SystemExit.new doesn't take a bool as exit status: It works well if an integer is given for status. % ./ruby -e 'SystemExit.new(0, "msg")' % ./ruby -e 'SystemExit.new(1, "msg")' But it doesn't work if the status is a bool. % ./ruby -e 'SystemExit.new(true, "msg")' -e:1:in `initialize': wrong number of arguments (2 for 0..1) (ArgumentError) from -e:1:in `initialize' from -e:1:in `new' from -e:1:in `
' % ./ruby -e 'SystemExit.new(false, "msg")' -e:1:in `initialize': wrong number of arguments (2 for 0..1) (ArgumentError) from -e:1:in `initialize' from -e:1:in `new' from -e:1:in `
' % ./ruby -v ruby 2.0.0dev (2011-12-08 trunk 33981) [x86_64-linux] I think SystemExit.new should accept a bool. -- http://redmine.ruby-lang.org