aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2010-07-29 00:27:38 -0400
committerRalph Amissah <ralph@amissah.com>2010-07-29 00:27:40 -0400
commit3946a7b8e45e27928e57ed9f85bac2ef2b927c0c (patch)
tree27961a147d5c7ada630ce6a07a83c7eb5ca770f0 /lib
parentsha256 (2.6.3) (diff)
options, minor code shuffling
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v2/options.rb40
1 files changed, 22 insertions, 18 deletions
diff --git a/lib/sisu/v2/options.rb b/lib/sisu/v2/options.rb
index 77e56a47..fbf8336a 100644
--- a/lib/sisu/v2/options.rb
+++ b/lib/sisu/v2/options.rb
@@ -69,29 +69,33 @@ module SiSU_commandline
a.each do |x|
y=case x
when /0/
- if x=~/^-1\S+/; x.gsub(/^-0(\S+)/,shortcut.cf_0 + ' -\1')
- else x.gsub(/^-0/,shortcut.cf_0 + ' ')
- end
+ (x=~/^-1\S+/) \
+ ? x.gsub(/^-0(\S+)/,shortcut.cf_0 + ' -\1') \
+ : x.gsub(/^-0/,shortcut.cf_0 + ' ')
when /1/
- if x=~/^-1\S+/; x.gsub(/^-1(\S+)/,shortcut.cf_1 + ' -\1')
- else x.gsub(/^-1/,shortcut.cf_1 + ' ')
- end
+ (x=~/^-1\S+/) \
+ ? x.gsub(/^-1(\S+)/,shortcut.cf_1 + ' -\1') \
+ : x.gsub(/^-1/,shortcut.cf_1 + ' ')
when /2/
- if x=~/^-2\S+/; x.gsub(/^-2(\S+)/,shortcut.cf_2 + ' -\1')
- else x.gsub(/^-2/,shortcut.cf_2 + ' ')
- end
+ (x=~/^-2\S+/) \
+ ? x.gsub(/^-2(\S+)/,shortcut.cf_2 + ' -\1') \
+ : x.gsub(/^-2/,shortcut.cf_2 + ' ')
when /3/
- if x=~/^-3\S+/; x.gsub(/^-3(\S+)/,shortcut.cf_3 + ' -\1')
- else x.gsub(/^-3/,shortcut.cf_3 + ' ')
- end
+ (x=~/^-3\S+/) \
+ ? x.gsub(/^-3(\S+)/,shortcut.cf_3 + ' -\1') \
+ : x.gsub(/^-3/,shortcut.cf_3 + ' ')
when /4/
- if x=~/^-4\S+/; x.gsub(/^-4(\S+)/,shortcut.cf_4 + ' -\1')
- else x.gsub(/^-4/,shortcut.cf_4 + ' ')
- end
+ (x=~/^-4\S+/) \
+ ? x.gsub(/^-4(\S+)/,shortcut.cf_4 + ' -\1') \
+ : x.gsub(/^-4/,shortcut.cf_4 + ' ')
when /5/
- if x=~/^-5\S+/; x.gsub(/^-5(\S+)/,shortcut.cf_5 + ' -\1')
- else x.gsub(/^-5/,shortcut.cf_5 + ' ')
- end
+ (x=~/^-5\S+/) \
+ ? x.gsub(/^-5(\S+)/,shortcut.cf_5 + ' -\1') \
+ : x.gsub(/^-5/,shortcut.cf_5 + ' ')
+ when /6/
+ (x=~/^-6\S+/) \
+ ? x.gsub(/^-6(\S+)/,shortcut.cf_5 + ' -\1') \
+ : x.gsub(/^-6/,shortcut.cf_5 + ' ')
else x
end
s << " #{y}" unless y.empty?