aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/command
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2017-03-09 20:27:39 +0100
committerGitHub <noreply@github.com>2017-03-09 20:27:39 +0100
commit9f9e57339bb88fcf5f8e47a048d8201b97cd5f53 (patch)
tree5c2f2d9ffcbdfd8cfe6e243e04391b10df003343 /railties/lib/rails/command
parentb16dcc872bb3c094cf1f1d890bdd302593acbbe8 (diff)
parent54ee15a203d7463534c2188141c6fb0090c9dc44 (diff)
downloadrails-9f9e57339bb88fcf5f8e47a048d8201b97cd5f53.tar.gz
rails-9f9e57339bb88fcf5f8e47a048d8201b97cd5f53.tar.bz2
rails-9f9e57339bb88fcf5f8e47a048d8201b97cd5f53.zip
Merge pull request #28182 from y-yagi/show_correct_rails_commands
Show correct commands in help
Diffstat (limited to 'railties/lib/rails/command')
-rw-r--r--railties/lib/rails/command/base.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/railties/lib/rails/command/base.rb b/railties/lib/rails/command/base.rb
index db20c71861..4f074df473 100644
--- a/railties/lib/rails/command/base.rb
+++ b/railties/lib/rails/command/base.rb
@@ -64,7 +64,7 @@ module Rails
end
def printing_commands
- namespace.sub(/^rails:/, "")
+ namespaced_commands
end
def executable
@@ -135,6 +135,12 @@ module Rails
def command_root_namespace
(namespace.split(":") - %w( rails )).first
end
+
+ def namespaced_commands
+ commands.keys.map do |key|
+ key == command_root_namespace ? key : "#{command_root_namespace}:#{key}"
+ end
+ end
end
def help