From 46da4b143f742ae8803f70e0718fe6ada27f7f82 Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Sat, 31 Dec 2016 19:14:08 +0100 Subject: Prevent command name being printed twice. Thor would inadvertantly duplicate the command usage because of the help method in a command class. Fixes #26664. [ Yuji Yaginuma & Kasper Timm Hansen ] --- railties/lib/rails/command/base.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'railties/lib/rails/command/base.rb') diff --git a/railties/lib/rails/command/base.rb b/railties/lib/rails/command/base.rb index 1efcd69e63..3f36c91c74 100644 --- a/railties/lib/rails/command/base.rb +++ b/railties/lib/rails/command/base.rb @@ -130,6 +130,14 @@ module Rails end end end + + def help + if command_name = self.class.command_name + self.class.command_help(shell, command_name) + else + super + end + end end end end -- cgit v1.2.3