diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-08-12 00:11:35 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-08-12 00:11:39 -0400 |
commit | 9680068ed1eee6cab4367714213f8052145529b6 (patch) | |
tree | 4efa5c8562147f644b7b300b2d78e9aaecb291d2 /lib/sisu/v6/hub_options.rb | |
parent | v5 v6: webrick, wb.cgi fixed & omitted/(use discarded) (diff) |
v5 v6: hub, organisation & loose endssisu_5.6.1
* tweak triggers
* split file further
* remove mod
Diffstat (limited to 'lib/sisu/v6/hub_options.rb')
-rw-r--r-- | lib/sisu/v6/hub_options.rb | 52 |
1 files changed, 38 insertions, 14 deletions
diff --git a/lib/sisu/v6/hub_options.rb b/lib/sisu/v6/hub_options.rb index acd95612..cedcdcfe 100644 --- a/lib/sisu/v6/hub_options.rb +++ b/lib/sisu/v6/hub_options.rb @@ -267,11 +267,11 @@ module SiSU_Commandline end def init a=@a + s=expand_numeric_shortcuts(a) + q=set_files_and_paths_and_general_extract(s) + files=(q[:files].length > 0) ? :true : :false + @select_arr=opt_cmd_and_mod_adjust(q[:opt_ch],q[:selections],files) if a.length > 0 - s=expand_numeric_shortcuts(a) - q=set_files_and_paths_and_general_extract(s) - files=(q[:files].length > 0) ? :true : :false - @select_arr=opt_cmd_and_mod_adjust(q[:opt_ch],q[:selections],files) @what=q[:what] unless q[:what].empty? @paths = q[:paths] @files = q[:files] @@ -557,10 +557,6 @@ module SiSU_Commandline s.strip! end def opt_cmd_and_mod_adjust(ch,select_arr,files) -if @select_arr.length > 0 - p __LINE__ - p @selection -end select_arr=select_arr.flatten sel_init=select_arr.flatten shortcut=SiSU_Env::InfoProcessingFlag.new @@ -709,7 +705,7 @@ end if ch =~/F/ then select_arr << '--sample-search-form' ch=ch.gsub(/[F]/,'') end - if ch =~/w/ then select_arr << '--webrick' + if ch =~/W/ then select_arr << '--webrick' ch=ch.gsub(/[w]/,'') end if ch =~/M/ then select_arr << '--maintenance' @@ -743,6 +739,12 @@ end end end else + if ch =~/c/ then select_arr << '--color-toggle' + ch=ch.gsub(/[c]/,'') + end + if ch =~/k/ then select_arr << '--color-off' + ch=ch.gsub(/[k]/,'') + end if ch =~/C/ then select_arr << '--config' ch=ch.gsub(/[C]+/,'') end @@ -754,9 +756,21 @@ end ch=ch.gsub(/[D]/,'') end end + if ch =~/W/ then select_arr << '--webrick' + ch=ch.gsub(/[w]/,'') + end if ch =~/v/ then select_arr << '--version' ch=ch.gsub(/[v]/,'') end + if ch =~/M/ then select_arr << '--maintenance' + ch=ch.gsub(/[M]/,'') + end + if ch =~/V/ then select_arr << '--very-verbose' + ch=ch.gsub(/[V]/,'') + end + if ch =~/q/ then select_arr << '--quiet' + ch=ch.gsub(/[q]/,'') + end end select_arr=select_arr.flatten.compact.uniq.sort end @@ -1360,10 +1374,20 @@ end :md5 else :na end - act[:sample_search_form]=select_arr.inspect \ - =~/"--sample-search-form"/ \ - ? { bool: true, set: :on } - : { bool: false, set: :na } + act[:sample_search_form]=if select_arr.inspect \ + =~/"--sample-search-form"/ + if select_arr.inspect \ + =~/"--db[-=]pg"/ + { bool: true, set: :on, db: :pg } + elsif select_arr.inspect \ + =~/"--db[-=]sqlite"/ + { bool: true, set: :on, db: :sqlite } + else + { bool: true, set: :on, db: :na } + end + else + { bool: false, set: :na, db: :na } + end act[:webrick]=select_arr.inspect \ =~/"--webrick"/ \ ? { bool: true, set: :on } @@ -1506,7 +1530,7 @@ end { bool: false, set: :na } end act[:verbose_plus]=if select_arr.inspect \ - =~/"--very-verbose"/ + =~/"--very-verbose"|"--verbose-very"/ act[:console_messages] << ' --very-verbose ' { bool: true, set: :on } else |