require 'commander' module Barman class CLI include Commander::Methods def run program :name, "barman" program :version, Barman::VERSION program :description, "Formulates and serves your project behind the bar." command :new do |c| c.syntax = "barman new [qa|rails]" c.description = "creates the base of your project" c.action do |args, options| create_project(args, options) end end run! end private def create_project(args, options) project_type = args.shift project_name = args.shift ProjectGenerator.new(project_type, project_name, options).generate! rescue NotImplementedError => e abort e.message end end end