Sha256: 7fcc159dcb090f75e3c8d1d9eb2d0b241f89ddc8afa3c107aafc324031fa964a
Contents?: true
Size: 1.14 KB
Versions: 2
Compression:
Stored size: 1.14 KB
Contents
#!/usr/bin/env ruby lib = File.expand_path('../../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'rubygems' require 'contexto' require 'optparse' require 'English' $stderr.sync = true options = {} options[:console] = false options[:ssh] = false optparse = OptionParser.new do |opts| opts.banner = 'Usage: contexto [options]' opts.on('-c', '--cluster CLUSTER', 'Cluster') { |v| options[:cluster] = v } opts.on('-s', '--service SERVICE', 'Service') { |v| options[:service] = v } opts.on('-t', '--container CONTAINER', 'Container') { |v| options[:container] = v } opts.on('-r', '--rake COMMAND', 'Rake command') { |v| options[:rake] = v } opts.on('-b', '--console') { options[:console] = true } opts.on('-f', '--ssh') { options[:ssh] = true } end begin optparse.parse! mandatory = [] missing = mandatory.select { |param| options[param].nil? } unless missing.empty? raise OptionParser::MissingArgument.new(missing.join(', ')) end rescue OptionParser::InvalidOption, OptionParser::MissingArgument puts $ERROR_INFO.to_s puts optparse exit end c = Contexto::Contextualize.new(options) c.run
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
contexto-0.2.3 | bin/contexto |
contexto-0.2.2 | bin/contexto |