Skip to content

Commit 3ea8333

Browse files
committed
Merge pull request #429 from rails/grosser/help
make help more accessible
2 parents 3332423 + d7f4779 commit 3ea8333

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/spring/client.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ module Spring
1414
module Client
1515
COMMANDS = {
1616
"help" => Client::Help,
17+
"-h" => Client::Help,
18+
"--help" => Client::Help,
1719
"binstub" => Client::Binstub,
1820
"stop" => Client::Stop,
1921
"status" => Client::Status,
2022
"rails" => Client::Rails,
2123
"-v" => Client::Version,
22-
"--version" => Client::Version
24+
"--version" => Client::Version,
2325
}
2426

2527
def self.run(args)

lib/spring/test/acceptance_test.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ def without_gem(name)
8484

8585
test "help message when called without arguments" do
8686
assert_success "bin/spring", stdout: 'Usage: spring COMMAND [ARGS]'
87+
assert app.spring_env.server_running?
88+
end
89+
90+
test "shows help" do
91+
assert_success "bin/spring help", stdout: 'Usage: spring COMMAND [ARGS]'
92+
assert_success "bin/spring -h", stdout: 'Usage: spring COMMAND [ARGS]'
93+
assert_success "bin/spring --help", stdout: 'Usage: spring COMMAND [ARGS]'
94+
refute app.spring_env.server_running?
8795
end
8896

8997
test "test changes are picked up" do

0 commit comments

Comments
 (0)