Sha256: d50af871b22e77a912448dffd5a07f97bf3db2e34c1b90e910a86e48598c0667
Contents?: true
Size: 935 Bytes
Versions: 22
Compression:
Stored size: 935 Bytes
Contents
module PKGWizard class Command include ::Mixlib::CLI option :help, :short => "-h", :long => "--help", :description => "Show this message", :on => :tail, :boolean => true, :show_options => true, :exit => 0 def self.registry @@registry ||= [] end def run(argv) @@argv = argv if @@argv.include?('--version') or @@argv.include?('-v') puts "PKG Wizard Version #{PKGWizard::VERSION}" exit 0 end cmd = argv.shift found = false @@registry.each do |c| if c[:name] == cmd c[:klass].perform found = true end end if not found puts puts "USAGE: #{File.basename($0)} command [options]" puts puts "Available Commands:" puts @@registry.each do |c| puts c[:name] end puts end end end end
Version data entries
22 entries across 22 versions & 1 rubygems