Permalink
Browse files

test: scan ARGV

* sample/test.rb: scan ARGV all.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 91aba07 commit 1ca611f360d96abf74d065f082e4b7d77fdfeb77 @nobu nobu committed Jun 26, 2012
Showing with 8 additions and 6 deletions.
  1. +8 −6 sample/test.rb
View
@@ -8,12 +8,14 @@
PROGRESS.instance_eval do
@color = nil
@quiet = nil
- case ARGV[0]
- when /\A--color(?:=(?:always|(auto)|(never)|(.*)))?\z/
- warn "unknown --color argument: #$3" if $3
- @color = $1 ? nil : !$2
- when /\A-(q|-quiet)\z/
- @quiet = true
+ ARGV.each do |arg|
+ case arg
+ when /\A--color(?:=(?:always|(auto)|(never)|(.*)))?\z/
+ warn "unknown --color argument: #$3" if $3
+ @color = $1 ? nil : !$2
+ when /\A-(q|-quiet)\z/
+ @quiet = true
+ end
end
@count = 0
@rotator = %w[- \\ | /]

0 comments on commit 1ca611f

Please sign in to comment.