diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-12-27 16:28:10 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-12-27 16:28:10 +0000 |
commit | 39020643147e4df0d40cb763952fbed1d3bbf4a0 (patch) | |
tree | 15c7027f3cd4e15a335f11ba103b6ab267f8b7a0 /instruby.rb | |
parent | c40c0f726b8f4a1aabdbc88ebf8958747af685cf (diff) | |
download | ruby-39020643147e4df0d40cb763952fbed1d3bbf4a0.tar.gz |
* instruby.rb: use getopts.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'instruby.rb')
-rw-r--r-- | instruby.rb | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/instruby.rb b/instruby.rb index 68b8bb4891..5c5b0b400f 100644 --- a/instruby.rb +++ b/instruby.rb @@ -6,21 +6,16 @@ include Config $:.unshift File.join(CONFIG["srcdir"], "lib") require 'fileutils' require 'shellwords' +require 'getopts' File.umask(0) -while arg = ARGV.shift - case arg - when /^--make-flags=(.*)/ - Shellwords.shellwords($1).grep(/^-[^-]*n/) {break $dryrun = true} - when "-n" - $dryrun = true - when /^-/ - else - destdir ||= arg - end +getopts("n", "make:", "make-flags:") +$dryrun = $OPT["n"] +Shellwords.shellwords($OPT["make-flags"] || "").grep(/^-[^-]*n/) do + break $dryrun = true end -destdir ||= '' +destdir = ARGV[0] || '' include FileUtils::Verbose include FileUtils::NoWrite if $dryrun |