Skip to content

Commit c2f9852

Browse files
committed
Fix regression displaying CLI help
1 parent 89a8cc7 commit c2f9852

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

features/docs/cli/help.feature

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Feature: Help
2+
3+
Running `cucumber --help` shows you command-line options.
4+
5+
Scenario: Show help
6+
When I run `cucumber --help`
7+
Then it should pass
8+
And I should see the CLI help
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Then(/^I should see the CLI help$/) do
2+
expect(all_output).to include("Usage:")
3+
end

lib/cucumber/cli/options.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def parse!(args)
135135
end
136136

137137
opts.on_tail("--version", "Show version.") { show_version }
138-
opts.on_tail("-h", "--help", "You're looking at it.") { show_help }
138+
opts.on_tail("-h", "--help", "You're looking at it.") { show_help(opts.help) }
139139
end.parse!
140140

141141
@args.map! { |a| "#{a}:#{@options[:lines]}" } if @options[:lines]
@@ -365,8 +365,8 @@ def set_dry_run_and_duration
365365
@options[:duration] = false
366366
end
367367

368-
def show_help
369-
@out_stream.puts opts.help
368+
def show_help(text)
369+
@out_stream.puts text
370370
Kernel.exit(0)
371371
end
372372

0 commit comments

Comments
 (0)