Permalink
Browse files

Add help to refinerycms command. #1538, #1539.

  • Loading branch information...
1 parent 229cd46 commit 8a1ae4580d172528cf5a1d82f1eb7e0999a8c2d1 @ugisozols ugisozols committed May 7, 2012
Showing with 15 additions and 1 deletion.
  1. +15 −1 bin/refinerycms
View
16 bin/refinerycms
@@ -2,9 +2,23 @@
gem 'railties'
require 'rails/generators'
require 'rails/generators/rails/app/app_generator'
+require File.expand_path('../../core/lib/generators/refinery/cms/cms_generator', __FILE__)
template_path = File.expand_path('../../templates/refinery/installer.rb', __FILE__)
+if ARGV.size == 0 || ARGV[0] == "--help"
+ puts "Usage:"
+ puts " refinerycms APP_NAME [options]"
+ puts ""
+ puts "Options:"
+ options = Refinery::CmsGenerator.class_options
+ options.keys.each do |option_key|
+ puts " --#{option_key}".ljust(28) << "# #{options[option_key].description}"
+ end
+ exit(0)
+end
+
application_name = ARGV.shift
+
result = Rails::Generators::AppGenerator.start [application_name, '-m', template_path, '--skip-test-unit'] | ARGV
if result && result.include?('Gemfile')
@@ -24,4 +38,4 @@ if result && result.include?('Gemfile')
note << "---------\n\n"
puts note
-end
+end

0 comments on commit 8a1ae45

Please sign in to comment.