Sha256: 4e07064daa5cc0d19c77302a29b4d3bde81866ad230aee010878123b718cd3e1
Contents?: true
Size: 1.01 KB
Versions: 9
Compression:
Stored size: 1.01 KB
Contents
#!/usr/bin/env ruby require 'rubygems' require 'trollop' require 'standup' opt_parser = Trollop::Parser.new do version "Standup #{Standup.version} (c) 2010 Ilia Ablamonov, Cloud Castle Inc." banner 'Standup is an application deployment and infrastructure management tool for Rails and Amazon EC2.' banner '' banner 'Usage:' banner ' standup [options] <script> [script arguments]' banner '' banner 'where <script> is one of the following:' banner '' offset = Standup.scripts.keys.map(&:length).max + 2 Standup.scripts.keys.sort.each do |name| banner "#{"%-#{offset}s" % name} #{Standup.scripts[name].description}" end banner '' banner "and [options] are:" banner '' stop_on Standup.scripts.keys end Trollop::with_standard_exception_handling opt_parser do opt_parser.parse ARGV raise Trollop::HelpNeeded if ARGV.empty? end script_name = ARGV.shift script = Standup.scripts[script_name] if script script.execute else opt_parser.die "unknown script #{script_name}", nil end
Version data entries
9 entries across 9 versions & 1 rubygems