Sha256: 7869ca6d9189ad4c1b6b95a851c92e3c32bf8decfe48d3505475ccab18805e32

Contents?: true

Size: 1.22 KB

Versions: 1

Compression:

Stored size: 1.22 KB

Contents

#!/usr/bin/env ruby
require 'rubygems'
require 'trollop'
require 'highline/import'
require 'virtualmonkey/command/create'
require 'virtualmonkey/command/destroy'
require 'virtualmonkey/command/run'
require 'virtualmonkey/command/list'
require 'virtualmonkey/command/troop'
require 'virtualmonkey/command/clone'

module VirtualMonkey
  module Command
    # Parses the initial command string, removing it from ARGV, then runs command.
    def self.go
      command = ARGV.shift
      case command
        when "create"
          VirtualMonkey::Command.create
        when "destroy"
          VirtualMonkey::Command.destroy
        when "run"
          VirtualMonkey::Command.run
        when "list"
          VirtualMonkey::Command.list
        when "troop"
          VirtualMonkey::Command.troop
        when "clone"
          VirtualMonkey::Command.clone
        when "help" || "--help" || "-h"
          puts "Help usage: monkey <command> --help"
          puts "Valid commands for monkey: create, destroy, list, run, troop, clone or help"
        else
          STDERR.puts "Invalid command #{command}: You need to specify a command for monkey: create, destroy, list, run, troop, clone or help\n"
          exit(1)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
virtualmonkey-0.0.1 lib/virtualmonkey/command.rb