Created
March 7, 2014 02:53
-
-
Save okochang/9404466 to your computer and use it in GitHub Desktop.
指定された引数(hoge,foo,bar)によってexit終了ステータスが変わる
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
option = ARGV[0] | |
def exit_test(option) | |
if option == "hoge" | |
puts "正常終了でほげ" | |
exit 0 | |
elsif option == "foo" | |
puts "異常終了でふー" | |
exit 1 | |
elsif option == "bar" | |
puts "異常終了でばー" | |
exit 2 | |
else | |
puts "なんだこれー" | |
exit 3 | |
end | |
end | |
exit_test(option) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment