This project is archived and is in readonly mode.

#3705 ✓resolved
Josh Nichols

[Patch] Improve readability of `script/generate` (without args)

Reported by Josh Nichols | January 16th, 2010 @ 04:38 AM

The current output of script/generate without any args isn't particularly readable (ie its hard to find the generator you want), and doesn't display usage (like script/generate scaffold does, for example):

$ script/generate 
Please select a generator.
Builtin: active_record:migration, active_record:model, active_record:observer, active_record:session_migration, app, controller, erb:controller, erb:mailer, erb:scaffold, generator, helper, integration_test, mailer, metal, migration, model, model_subclass, observer, performance_test, plugin, resource, scaffold, scaffold_controller, session_migration, stylesheets, test_unit:controller, test_unit:helper, test_unit:integration, test_unit:mailer, test_unit:model, test_unit:observer, test_unit:performance, test_unit:plugin, test_unit:scaffold.

If I were to suggest something, I'd go for more like:

$ script/generate 
Usage
  script/generate [generator] [generate-specific options]
 
Builtin Generators:
    active_record:migration
    active_record:model
    active_record:observer
    active_record:session_migration
    app
    controller
    erb:controller
    erb:mailer
    erb:scaffold
    generator
    helper
    integration_test
    mailer
    metal
    migration
    model
    model_subclass
    observer
    performance_test
    plugin
    resource
    scaffold
    scaffold_controller
    session_migration
    stylesheets
    test_unit:controller
    test_unit:helper
    test_unit:integration
    test_unit:mailer
    test_unit:model
    test_unit:observer
    test_unit:performance
    test_unit:plugin
    test_unit:scaffold

It is certainly more lines of output, but, it's a lot easier to grep/less/scroll to find what you're looking for.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages