summaryrefslogtreecommitdiff
path: root/sample/test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'sample/test.rb')
-rwxr-xr-xsample/test.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/sample/test.rb b/sample/test.rb
index b32a164..839343e 100755
--- a/sample/test.rb
+++ b/sample/test.rb
@@ -8,8 +8,9 @@ PROGRESS = Object.new
PROGRESS.instance_eval do
@color = nil
case ARGV[0]
- when /\A--color(?:=(?:always|(auto)|(never)))?\z/
- @color = (!$2 unless $1)
+ when /\A--color(?:=(?:always|(auto)|(never)|(.*)))?\z/
+ warn "unknown --color argument: #$3" if $3
+ @color = $1 ? nil : !$2
end
@count = 0
@rotator = %w[- \\ | /]