Module: DO::CLI

Extended by:
CLI
Included in:
CLI
Defined in:
lib/do/cli.rb

Instance Method Summary collapse

Instance Method Details

#start(*args) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/do/cli.rb', line 5

def start(*args)
  DO::Commands.load_recipes
  args.empty? ? DO::Commands.run_task(:help) : DO::Commands.task_run(*args)
rescue DO::Tasks::NotFound
  puts "\e[31mSorry, \e[1m'%s'\e[0m\e[31m was not found, see available tasks:\e[0m" % args.join(' ')
  puts
  DO::Commands.run_task(:list)
end