This project is archived and is in readonly mode.
[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
-
Josh Nichols January 16th, 2010 @ 05:39 AM
- Tag changed from rails3, rails_generator to bugmash, rails3, rails_generator
-
Rizwan Reza January 16th, 2010 @ 08:04 AM
+1
The patch for the above output is attached. I've tested again by reapplying it to master. It applies cleanly.
-
Ravil Bayramgalin January 16th, 2010 @ 08:12 AM
+1 I've attached a patch which fixes grammar mistake in previous one, adds correct whitespace offset for generator names and updates a failing test.
-
Rizwan Reza January 16th, 2010 @ 03:51 PM
- Title changed from imrove readability of `script/generate` (without args) to [Patch] Improve readability of `script/generate` (without args)
-
José Valim January 16th, 2010 @ 04:05 PM
- State changed from new to open
- Assigned user set to José Valim
-
José Valim January 18th, 2010 @ 03:32 PM
- State changed from open to resolved
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>