lib/geocoder/cli.rb in geocoder-1.0.5 vs lib/geocoder/cli.rb in geocoder-1.1.0
- old
+ new
@@ -11,11 +11,16 @@
OptionParser.new{ |opts|
opts.banner = "Usage:\n geocode [options] <location>"
opts.separator "\nOptions: "
opts.on("-k <key>", "--key <key>",
- "Key for geocoding API (optional for most)") do |key|
- Geocoder::Configuration.api_key = key
+ "Key for geocoding API (optional for most). For Google Premier use 'key client channel' separated by spaces") do |key|
+ premier_key = key.split(' ')
+ if premier_key.length == 3
+ Geocoder::Configuration.api_key = premier_key
+ else
+ Geocoder::Configuration.api_key = key
+ end
end
opts.on("-l <language>", "--language <language>",
"Language of output (see API docs for valid choices)") do |language|
Geocoder::Configuration.language = language