Sha256: 192e0c100b4056b47dfa1e8d0dfb06b1cdbfa534356d380fb9bcd39ccea351ef
Contents?: true
Size: 931 Bytes
Versions: 2
Compression:
Stored size: 931 Bytes
Contents
#!/usr/bin/env ruby #/ Usage: steamy HOST DATABASE #/ require 'boot' require 'optparse' def usage puts File.readlines(__FILE__). grep(/^#\/.*/). map { |line| line.chomp[3..-1] }. join("\n") end options = {} optparse = OptionParser.new do |opts| 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 ARGV.clear rescue OptionParser::InvalidOption, OptionParser::MissingArgument puts $!.to_s usage exit 1 end instance = Steamy::App.new(options[:host], options[:database]) instance.dump
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
steamy-0.0.5 | bin/steamy |
steamy-0.0.4 | bin/steamy |