summaryrefslogtreecommitdiff
path: root/instruby.rb
diff options
context:
space:
mode:
Diffstat (limited to 'instruby.rb')
-rw-r--r--instruby.rb17
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