Class: Icarus::Mod::CLI::Command

Inherits:
Base
  • Object
show all
Defined in:
lib/icarus/mod/cli/command.rb

Overview

The main CLI Command class for Icarus Mod Tools

Instance Method Summary collapse

Methods inherited from Base

exit_on_failure?

Constructor Details

#initialize(*args) ⇒ Command

Returns a new instance of Command.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/icarus/mod/cli/command.rb', line 15

def initialize(*args)
  super

  if options[:version]
    puts "IcarusModTool (imt) v#{Icarus::Mod::VERSION}"
    exit 0
  end

  unless File.exist?(options[:config])
    warn "Could not find or read Config from '#{options[:config]}' - please create it or specify a different path with -C"
    exit 1
  end

  Icarus::Mod::Config.read(options[:config])
end