Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9842 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

[PATCH] UI improvements to "overwrite" handling in rails command-line tool

Reported by: wincent Assigned to: core
Priority: normal Milestone: 2.x
Component: ActiveRecord Version: edge
Severity: normal Keywords:
Cc:

Description

The user experience when running the "rails" command-line tool and faced with an overwrite prompt isn't as good as it could be. I made some notes on this at:

http://wincent.com/a/about/wincent/weblog/archives/2007/10/bad_ui_design_i.php

The attached patch addresses the concerns in the following ways:

1. Provides a more user-friendly prompt when asking whether to overwrite:

overwrite README? (enter "h" for help) [Ynaqdh]

2. Add code to display the help:

Y - yes, overwrite
n - no, do not overwrite
a - all, overwrite this and all others
q - quit, abort
d - diff, show the differences between the old and the new
h - help, show this help
overwrite README? (enter "h" for help) [Ynaqdh]

3. Don't default to forcing an override when receiving an unrecognized option; instead show the help.

4. Don't use sloppy regexes.

Attachments

rails_overwrite_improvements.diff (1.6 kB) - added by wincent on 10/11/07 14:47:21.

Change History

10/11/07 14:47:21 changed by wincent

  • attachment rails_overwrite_improvements.diff added.

10/11/07 14:49:11 changed by wincent

Uploaded a new attachment; mistakenly attached the wrong diff when opening this ticket.

10/11/07 15:14:07 changed by hkstar

+1 very welcome patch. the diff especially will be helpful in the future. Looking good here

10/11/07 15:15:35 changed by david

  • status changed from new to closed.
  • resolution set to fixed.

(In [7837]) Added better documentation for generator overwrite options (closes #9842) [wincet]