Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Rails runner help message is sent to stderr instead of stdout

#5661
(ruby-1.9.2@rails)(~/bugmash/detour)९ rails --help 2>/dev/null 
Usage: rails COMMAND [ARGS]

The most common rails commands are:
 generate    Generate new code (short-cut alias: "g")
 console     Start the Rails console (short-cut alias: "c")
 server      Start the Rails server (short-cut alias: "s")
 dbconsole   Start a console for the database specified in config/database.yml
             (short-cut alias: "db")
.
.
.



(ruby-1.9.2@rails)(~/bugmash/detour)९ rails generate --help 2>/dev/null 
Usage: rails generate GENERATOR [args] [options]

General options:
  -h, [--help]     # Print generator's options and usage
  -p, [--pretend]  # Run but do not make any changes
  -f, [--force]    # Overwrite files that already exist
  -s, [--skip]     # Skip files that already exist
  -q, [--quiet]    # Suppress status output

Please choose a generator below.
.
.
.

(ruby-1.9.2@rails)(~/bugmash/detour)९ rails runner --help 2>/dev/null

It makes more sense to output help messages to stdout instead of stderr. It's easier to pipe and search (via grep) and for other reasons as well => http://stackoverflow.com/questions/1068020/app-help-should-go-to-st...

Attached is a patch that fixes this and also removes a hack in recently added test.

Reported by Rohit Arondekar · September 19th, 2010 @ 08:50 AM

State: committed
Milestone: 3.0.2
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. David Trasbo
    David Trasbo

    +1

    I propose silencing the --help output in the test to avoid noise. I've amended your patch to do that.

    September 19th, 2010 @ 02:16 PM

  2. Rohit Arondekar
    Rohit Arondekar

    Why do you need to use silence? For me, on 1.9.2 the master branch the help text doesn't get output while running the tests. Does that happen for you?

    September 19th, 2010 @ 04:00 PM

  3. David Trasbo
    David Trasbo

    It did, yes. I'll try again, though.

    September 19th, 2010 @ 04:01 PM

  4. Repository
    Repository
    • State changed from new to committed

    September 20th, 2010 @ 12:45 AM

  5. Repository
  6. Rohit Arondekar
    Rohit Arondekar
    • State changed from committed to open

    One last patch only for 3-0-stable to fix the failing test.

    This happened because the patch in #4249 [rails3 beta] "rails runner" can't be used in shebang lines didn't get applied to 3-0-stable before this one.

    September 20th, 2010 @ 05:16 AM

  7. Repository
  8. Jeremy Kemper