Module: Pasqual::Arglist
- Defined in:
- lib/pasqual/arglist.rb
Class Method Summary collapse
Class Method Details
.args(program, username, password, host, port, name) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/pasqual/arglist.rb', line 5 def self.args(program, username, password, host, port, name) list = [] list << '-h' << host if host.to_s.length > 0 list << '-U' << username if username.to_s.length > 0 list << '-p' << port.to_s if port.to_s.length > 0 list << '-w' if password.to_s.length == 0 if program == 'psql' list << '--no-psqlrc' list << '--pset' << 'pager=off' end list + [name] end |