class Manlycraft::Cli

Public Class Methods

start(*args) click to toggle source
# File lib/manlycraft/cli.rb, line 5
def self.start(*args)
  begin
    if $stdin.isatty
      $stdin.sync = true
    end
    if $stdout.isatty
      $stdout.sync = true
    end

    command = args.shift.strip rescue "help"

    Manlycraft::Command.load
    Manlycraft::Command.run(command, args)
  rescue Interrupt
    `stty icanon echo`
    error("Command cancelled.")
  #rescue => error
    #puts error
    #exit(1)
  end
end