Sha256: 6811d1cd9d573bcb525e8b795169f3d3e03eebe13781ad6bfca9bb843da7d18d

Contents?: true

Size: 984 Bytes

Versions: 9

Compression:

Stored size: 984 Bytes

Contents

#!/usr/bin/env ruby

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- 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

9 entries across 9 versions & 1 rubygems

Version Path
right_develop-2.1.5 bin/right_develop
right_develop-2.1.3 bin/right_develop
right_develop-2.1.2 bin/right_develop
right_develop-2.1.1 bin/right_develop
right_develop-2.1.0 bin/right_develop
right_develop-2.0.2 bin/right_develop
right_develop-2.0.1 bin/right_develop
right_develop-1.2.2 bin/right_develop
right_develop-1.2.0 bin/right_develop