Module: Crew::CLI::Processor
Instance Method Summary collapse
Instance Method Details
#dispatch(args) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/crew/cli.rb', line 6 def dispatch(args) if commands.include?(args.first) method(args.shift.gsub(/-/, '_').to_sym).call(args) elsif args.first.nil? help(args) else help(args) error "Unknown command #{args.join(", ")}" end end |