module David

Constants

VERSION

Public Class Methods

get_command(conf, args) click to toggle source
# File lib/david.rb, line 23
def self.get_command(conf, args)
  if args.size == 1
    if args[0].start_with? '-'
      return nil
    else
      return Command.new(conf, nil).parse_args(args)
    end
  elsif args.size > 1
    return Command.new(conf, nil).parse_args(args)
  else
    return nil
  end
end
main() click to toggle source

Your code goes here…

# File lib/david.rb, line 9
def self.main
  puts ARGV
  args = ARGV

  conf = Configure.new
  cmd = self.get_command(conf, args)

  if cmd.nil?
    Command.interact(conf)
  else
    cmd.execute
  end
end