Skip to content
Snippets Groups Projects
Commit fc312910 authored by Stephen Ball's avatar Stephen Ball
Browse files

updated cli to accept google premier key

parent 47edf4e3
No related branches found
No related tags found
No related merge requests found
...@@ -13,8 +13,14 @@ module Geocoder ...@@ -13,8 +13,14 @@ module Geocoder
opts.separator "\nOptions: " opts.separator "\nOptions: "
opts.on("-k <key>", "--key <key>", opts.on("-k <key>", "--key <key>",
"Key for geocoding API (optional for most)") do |key| "Key for geocoding API (optional for most). For Google Premier use 'key client channel' separated by spaces") do |key|
Geocoder::Configuration.api_key = key premier_key = key.split(' ')
if premier_key.length == 3
Geocoder::Configuration.api_key = premier_key
else
Geocoder::Configuration.api_key = key
end
puts Geocoder::Configuration.api_key.inspect
end end
opts.on("-l <language>", "--language <language>", opts.on("-l <language>", "--language <language>",
...@@ -30,6 +36,7 @@ module Geocoder ...@@ -30,6 +36,7 @@ module Geocoder
opts.on("-s <service>", Geocoder.street_lookups, "--service <service>", opts.on("-s <service>", Geocoder.street_lookups, "--service <service>",
"Geocoding service: #{Geocoder.street_lookups * ', '}") do |service| "Geocoding service: #{Geocoder.street_lookups * ', '}") do |service|
Geocoder::Configuration.lookup = service.to_sym Geocoder::Configuration.lookup = service.to_sym
puts Geocoder::Configuration.lookup.inspect
end end
opts.on("-t <seconds>", "--timeout <seconds>", opts.on("-t <seconds>", "--timeout <seconds>",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment