From 6813edc7d926965e5644cd8befaf229a35b9d8ca Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Sat, 28 May 2016 22:04:13 +0200 Subject: Initial command structure. --- railties/lib/rails/commands/help/USAGE | 16 ++++++++++++++++ railties/lib/rails/commands/help/help_command.rb | 13 +++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 railties/lib/rails/commands/help/USAGE create mode 100644 railties/lib/rails/commands/help/help_command.rb (limited to 'railties/lib/rails/commands/help') diff --git a/railties/lib/rails/commands/help/USAGE b/railties/lib/rails/commands/help/USAGE new file mode 100644 index 0000000000..0f6ff756ce --- /dev/null +++ b/railties/lib/rails/commands/help/USAGE @@ -0,0 +1,16 @@ +Usage: bin/rails COMMAND [args] [options] + +The most common rails commands are: + generate Generate new code (short-cut alias: "g") + console Start the Rails console (short-cut alias: "c") + server Start the Rails server (short-cut alias: "s") + test Run tests (short-cut alias: "t") + dbconsole Start a console for the database specified in config/database.yml + (short-cut alias: "db") + new Create a new Rails application. "rails new my_app" creates a + new application called MyApp in "./my_app" + +All commands can be run with -h (or --help) for more information. + +In addition to those commands, there are: + diff --git a/railties/lib/rails/commands/help/help_command.rb b/railties/lib/rails/commands/help/help_command.rb new file mode 100644 index 0000000000..5bcc4c8eee --- /dev/null +++ b/railties/lib/rails/commands/help/help_command.rb @@ -0,0 +1,13 @@ +module Rails + module Command + class HelpCommand < Base + hide_command! + + def help(*) + puts self.class.desc + + Rails::Command.print_commands + end + end + end +end -- cgit v1.2.3