diff options
author | Ralph Amissah <ralph@amissah.com> | 2010-07-29 00:28:12 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2010-07-29 00:28:12 -0400 |
commit | 6b9582f14e30e673c42263dc59745c4315327322 (patch) | |
tree | 61a83183dd051334c9ca52e48f8770d18cb85ac0 /lib | |
parent | debian/changelog 2.6.3-1 (diff) | |
parent | options, minor code shuffling (diff) |
Merge branch 'upstream' into debian/sid
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v2/options.rb | 40 |
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? |