summaryrefslogtreecommitdiff
path: root/lib/getopts.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-08-13 05:45:20 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-08-13 05:45:20 +0000
commit65a5162550f58047974793cdc8067a970b2435c0 (patch)
tree082bb7d5568f3b2e36e3fe166e9f3039394fcf44 /lib/getopts.rb
parentfcd020c83028f5610d382e85a2df00223e12bd7e (diff)
1.4.0
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/getopts.rb')
-rw-r--r--lib/getopts.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/getopts.rb b/lib/getopts.rb
index 9e1e8a2..5b9562d 100644
--- a/lib/getopts.rb
+++ b/lib/getopts.rb
@@ -15,7 +15,7 @@ $RCS_ID=%q$Header$
def isSingle(lopt)
if lopt.index(":")
if lopt.split(":")[0].length == 1
- return TRUE
+ return true
end
end
return nil
@@ -87,13 +87,13 @@ def getopts(single_opts, *options)
return nil
end
setOption(compare, ARGV[1])
- opts[compare] = TRUE
+ opts[compare] = true
ARGV.shift
count += 1
break
elsif lo == compare
- setOption(compare, TRUE)
- opts[compare] = TRUE
+ setOption(compare, true)
+ opts[compare] = true
count += 1
break
end
@@ -106,19 +106,19 @@ def getopts(single_opts, *options)
for idx in 1..(ARGV[0].length - 1)
compare = ARGV[0][idx, 1]
if single_opts && compare =~ "[" + single_opts + "]"
- setOption(compare, TRUE)
- opts[compare] = TRUE
+ setOption(compare, true)
+ opts[compare] = true
count += 1
elsif single_colon != "" && compare =~ "[" + single_colon + "]"
if ARGV[0][idx..-1].length > 1
setOption(compare, ARGV[0][(idx + 1)..-1])
- opts[compare] = TRUE
+ opts[compare] = true
count += 1
elsif ARGV.length <= 1
return nil
else
setOption(compare, ARGV[1])
- opts[compare] = TRUE
+ opts[compare] = true
ARGV.shift
count += 1
end
@@ -127,7 +127,7 @@ def getopts(single_opts, *options)
end
else
compare = ARGV[0]
- opts[compare] = TRUE
+ opts[compare] = true
newargv << ARGV[0]
end