17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/posgra/cli/helper.rb', line 17
def client
client_options = {}
String.colorize = options[:color]
Posgra::Logger.instance.set_debug(options[:debug])
options.each do |key, value|
if key.to_s =~ /-/
key = key.to_s.gsub('-', '_')
end
client_options[key.to_sym] = value if value
end
REGEXP_OPTIONS.each do |key|
if client_options[key]
client_options[key] = Regexp.new(client_options[key])
end
end
client_options[:identifier] = Posgra::Identifier::Auto.new(options['account-output'], client_options)
Posgra::Client.new(client_options)
end
|