module Rails::Generators
def self.help(command = 'generate')
def self.help(command = 'generate') lookup! namespaces = subclasses.map{ |k| k.namespace } namespaces.sort! groups = Hash.new { |h,k| h[k] = [] } namespaces.each do |namespace| base = namespace.split(':').first groups[base] << namespace end puts "Usage: rails #{command} GENERATOR [args] [options]" puts puts "General options:" puts " -h, [--help] # Print generator's options and usage" puts " -p, [--pretend] # Run but do not make any changes" puts " -f, [--force] # Overwrite files that already exist" puts " -s, [--skip] # Skip files that already exist" puts " -q, [--quiet] # Suppress status output" puts puts "Please choose a generator below." puts # Print Rails defaults first. rails = groups.delete("rails") rails.map! { |n| n.sub(/^rails:/, '') } rails.delete("app") print_list("rails", rails) hidden_namespaces.each {|n| groups.delete(n.to_s) } groups.sort.each { |b, n| print_list(b, n) } end