Method: App42::Command::Client.app42

Defined in:
lib/app42/command/client.rb

.app42(*args) ⇒ Object

call for require files Initiate client object

Parameters:

  • args


33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/app42/command/client.rb', line 33

def self.app42(*args )
  begin
    action = args.shift.strip rescue 'help'
    App42::Command::Client.new.load_command_file
    App42::Command::Client.new.start(action, args)
  rescue Interrupt => e 
    @exception_msg = e.message
  rescue OptionParser::MissingArgument => e
    @exception_msg = e.message
  rescue OptionParser::InvalidOption => e 
    @exception_msg = e.message
  rescue OptionParser::AmbiguousOption => e  
    @exception_msg = e.message
  rescue => error
    @exception_msg = e.message
  ensure
    puts Paint["#{@exception_msg}", :red] 
    @should_exit = true if @should_exit.nil?
    exit @should_exit   
  end

end