bin/steamy in steamy-0.0.3 vs bin/steamy in steamy-0.0.4

- old
+ new

@@ -1,9 +1,9 @@ #!/usr/bin/env ruby #/ Usage: steamy HOST DATABASE #/ -require 'steamy' +require 'boot' require 'optparse' def usage puts File.readlines(__FILE__). grep(/^#\/.*/). @@ -18,19 +18,25 @@ opts.on('-v', '--version') do puts Steamy::VERSION exit 0 end + opts.on('-d', '--databases HOST') do |host| + instance = Steamy::App.new(host) + instance.available_databases + exit 0 + end + opts.on('-h', '--help', 'Display help info') do usage exit 0 end end begin optparse.parse! - + # The url has no flag and will be in ARGV[0] if it's set options[:host] = ARGV[0] || nil options[:database] = ARGV[1] || nil # Reset ARGV for gets later @@ -40,7 +46,7 @@ puts $!.to_s usage exit 1 end -preview = Steamy::Steamy.new(options[:host], options[:database]) -preview.mysqldump +instance = Steamy::App.new(options[:host], options[:database]) +instance.dump \ No newline at end of file