aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/command
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-12-31 19:14:08 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2016-12-31 19:25:18 +0100
commit46da4b143f742ae8803f70e0718fe6ada27f7f82 (patch)
tree807a3121ae2e4288236cd284dc252228e008183e /railties/lib/rails/command
parentd753645d40e925973724e4c3a8617b654da90e41 (diff)
downloadrails-46da4b143f742ae8803f70e0718fe6ada27f7f82.tar.gz
rails-46da4b143f742ae8803f70e0718fe6ada27f7f82.tar.bz2
rails-46da4b143f742ae8803f70e0718fe6ada27f7f82.zip
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 ]
Diffstat (limited to 'railties/lib/rails/command')
-rw-r--r--railties/lib/rails/command/base.rb8
1 files changed, 8 insertions, 0 deletions
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