diff options
author | Richard Schneeman <richard.schneeman@gmail.com> | 2015-04-16 00:00:34 -0500 |
---|---|---|
committer | Richard Schneeman <richard.schneeman@gmail.com> | 2015-04-16 00:00:34 -0500 |
commit | e263923573f03b874af7c6d18a91019dadf19705 (patch) | |
tree | 13659336d7e81e3be6a3fb51779892c22f78dd31 | |
parent | 5256ada75dea2a9466cb09afe25f79f956b18b9e (diff) | |
parent | 7937c6aa008d1a5073fe84f260b848f531ce6a10 (diff) | |
download | rails-e263923573f03b874af7c6d18a91019dadf19705.tar.gz rails-e263923573f03b874af7c6d18a91019dadf19705.tar.bz2 rails-e263923573f03b874af7c6d18a91019dadf19705.zip |
Merge pull request #19778 from thenickcox/commands_docs
[ci skip] Document running a rake command as a rails command
-rw-r--r-- | railties/lib/rails/commands/commands_tasks.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/railties/lib/rails/commands/commands_tasks.rb b/railties/lib/rails/commands/commands_tasks.rb index d8d4080c3e..685d55eea8 100644 --- a/railties/lib/rails/commands/commands_tasks.rb +++ b/railties/lib/rails/commands/commands_tasks.rb @@ -151,6 +151,17 @@ EOT puts HELP_MESSAGE end + # Output an error message stating that the attempted command is not a valid rails command. + # Run the attempted command as a rake command with the --dry-run flag. If successful, suggest + # to the user that they possibly meant to run the given rails command as a rake command. + # Append the help message. + # + # Example: + # $ rails db:migrate + # Error: Command 'db:migrate' not recognized + # Did you mean: `$ rake db:migrate` ? + # (Help message output) + # def write_error_message(command) puts "Error: Command '#{command}' not recognized" if %x{rake #{command} --dry-run 2>&1 } && $?.success? |