This option is like --silent except if there is an error it will print a full backtrace.
The motivation for this option is cronjobs. We get emails about cron tasks if there is any output at all, hence we use --silent to quiet rake down. But if a cronjob has failed (often overnight) you would like the email to contain as much information as possible about the error, so this prints backtraces.
BTW this relies on the previous pull request about tests to make it's tests work.
Several tests of exception handling weren't testing what they appeare…
…d to be.
Added --cron option. Works like silent, except if there is an error it
prints the full backtrace.
Simplify exception tests a bit
Merge branch 'fix-exception-tests' into add-cron-option
--cron should silence deprecation warnings as well
Interesting idea ... I'm considering it. Not wild about the option name, I would rather name it for what it does rather than where it is intended to be used.
Good thinking. I'm finding it hard to come up with better names that aren't verbose. --silent-trace perhaps?
I never understood why backtraces were suppressed in the first place. I have performed this ritual many times: swear, add --trace, re-run, wait all over again. In fact I think this was the genesis of Drake.
Besides cron jobs this will also be useful in rake tasks run during deployment. For example, when doing a fresh deployment, if a rake task fails the remote source tree is destroyed and thus even invoking rake with --trace is not easily possible.
As others said I do not understand why printing backtraces is not default behavior: #31
Rake in master now prints a truncated backtrace by default. Is this sufficient for you?