1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/lib/rails/commands/generate/generate_command.rb
yuuji.yaginuma 54ee15a203 Show correct commands in help
Currently rails' help shows only namespace. However, the secrets command
needs to specify command. Therefore, I fixed the command to display in help.
2017-03-03 08:18:51 +09:00

28 lines
608 B
Ruby

require "rails/generators"
module Rails
module Command
class GenerateCommand < Base # :nodoc:
no_commands do
def help
require_application_and_environment!
load_generators
Rails::Generators.help self.class.command_name
end
end
def perform(*)
generator = args.shift
return help unless generator
require_application_and_environment!
load_generators
ARGV.shift
Rails::Generators.invoke generator, args, behavior: :invoke, destination_root: Rails::Command.root
end
end
end
end