提交 bde14bef 编写于 作者: H Hrvoje Šimić

better error message when app name is not passed in `rails new`

Prior to this change, for the following command:

    $ rails new

we received "Options should be given after the application name" as an error message.

This is outdated and should be "Application name should be provided in arguments".
上级 2519fb0e
......@@ -151,7 +151,15 @@ class AppGenerator < AppBase # :nodoc:
desc: "Show Rails version number and quit"
def initialize(*args)
raise Error, "Options should be given after the application name. For details run: rails --help" if args[0].blank?
if args[0].blank?
if args[1].blank?
# rails new
raise Error, "Application name should be provided in arguments. For details run: rails --help"
else
# rails new --skip-bundle my_new_application
raise Error, "Options should be given after the application name. For details run: rails --help"
end
end
super
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册