aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/cgi.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v5/cgi.rb')
-rw-r--r--lib/sisu/v5/cgi.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/sisu/v5/cgi.rb b/lib/sisu/v5/cgi.rb
index dd9cdf22..1c0e023a 100644
--- a/lib/sisu/v5/cgi.rb
+++ b/lib/sisu/v5/cgi.rb
@@ -70,8 +70,20 @@ module SiSU_CGI
@webserv=@opt.files[0].to_s.strip
end
def read
- SiSU_CGI_SQLite::SearchSQLite.new(@opt,@webserv).sqlite
- SiSU_CGI_PgSQL::SearchPgSQL.new(@opt,@webserv).pgsql
+ if @opt.mod.inspect =~/--db[=-]["']?(?:pg|pg?sql|postgres(?:ql)?)["']+/
+ SiSU_CGI_PgSQL::SearchPgSQL.new(@opt,@webserv).pgsql
+ elsif @opt.mod.inspect =~/--db[=-](?:sqlite)/
+ SiSU_CGI_SQLite::SearchSQLite.new(@opt,@webserv).sqlite
+ else
+ puts <<-WOK
+ please select database type for which sample search form should be built (pgsql or sqlite)
+ sisu --sample-search-form --db=sqlite
+ sisu --sample-search-form --db=pg
+ other options include
+ --webserv-cgi='[cgi-server-name]'
+ --webserv-output='[sisu-output-server-with-base-path]'
+ WOK
+ end
end
end
end