diff options
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/get_distribution_image.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/get_distribution_image.rb b/examples/get_distribution_image.rb index 96500a4..b840a1a 100755 --- a/examples/get_distribution_image.rb +++ b/examples/get_distribution_image.rb @@ -1,17 +1,18 @@ #!/usr/bin/ruby # -# get_distribution_image DB KEY +# get_distribution_image DB KEY nodes|ways # require 'rubygems' require 'sqlite3' filename = ARGV[0] -key = ARGV[1] +key = ARGV[1] +type = ARGV[2] db = SQLite3::Database.new(filename) -db.execute("SELECT png FROM key_distributions WHERE key=?", key) do |row| - puts row[0] +db.execute("SELECT #{type} FROM key_distributions WHERE key=?", key) do |row| + $stdout.write row[0] end |