Sha256: 5ecc5a1357364cc2ed546db730f48bd9460e43499edcb0497b7b5455a7f24b9b
Contents?: true
Size: 1.07 KB
Versions: 15
Compression:
Stored size: 1.07 KB
Contents
#!/usr/bin/env ruby unless Gem.respond_to?(:latest_spec_for) fail 'right_develop command line tools require rubygems v1.8+' end require "trollop" require "right_develop" gemspec = Gem.latest_spec_for("right_develop") commands = {} RightDevelop::Commands.constants.each do |konst| name = konst.to_s.downcase commands[name] = RightDevelop::Commands.const_get(konst.to_sym) end # Use a Trollop parser for help/banner display, but do not actually parse anything # just yet. command_list = commands.keys.map { |c| " * #{c}" }.join("\n") p = Trollop::Parser.new do version "right_develop #{gemspec.version} (c) 2013-2014 RightScale, Inc." banner <<-EOS A command-line interface to various tools offered by the right_develop gem. Usage: right_develop <command> [options] Where <command> is one of: #{command_list} To get help on a command: right_develop <command> --help EOS stop_on commands.keys end opts = Trollop::with_standard_exception_handling p do raise Trollop::HelpNeeded if ARGV.empty? p.parse ARGV cmd = ARGV.shift commands[cmd].create.run end
Version data entries
15 entries across 15 versions & 1 rubygems