mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* instruby.rb: use getopts.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c40c0f726b
commit
3902064314
1 changed files with 6 additions and 11 deletions
17
instruby.rb
17
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
|
||||
|
|
Loading…
Add table
Reference in a new issue