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 | f0f04f0aca45b930a6d5c5f3ab139233ddffc9bc (patch) | |
tree | 15c7027f3cd4e15a335f11ba103b6ab267f8b7a0 /instruby.rb | |
parent | 284e4bb1e1f4f228dec73b5f510b225dae942e55 (diff) | |
download | ruby-f0f04f0aca45b930a6d5c5f3ab139233ddffc9bc.tar.gz ruby-f0f04f0aca45b930a6d5c5f3ab139233ddffc9bc.tar.xz ruby-f0f04f0aca45b930a6d5c5f3ab139233ddffc9bc.zip |
* instruby.rb: use getopts.rb.
git-svn-id: http://svn.ruby-lang.org/repos/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 68b8bb489..5c5b0b400 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 |