Skip to content

Commit

Permalink
Refactor / extract method
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwynne committed Jul 2, 2016
1 parent b739a6e commit 3a27fa1
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/cucumber/cli/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ def parse!(args)
end
end

opts.on_tail("--version", "Show version.") { show_version }
opts.on_tail("-h", "--help", "You're looking at it.") { show_help(opts.help) }
opts.on_tail("--version", "Show version.") { exit_ok(Cucumber::VERSION) }
opts.on_tail("-h", "--help", "You're looking at it.") { exit_ok(opts.help) }
end.parse!

@args.map! { |a| "#{a}:#{@options[:lines]}" } if @options[:lines]
Expand Down Expand Up @@ -365,16 +365,11 @@ def set_dry_run_and_duration
@options[:duration] = false
end

def show_help(text)
def exit_ok(text)
@out_stream.puts text
Kernel.exit(0)
end

def show_version
@out_stream.puts Cucumber::VERSION
Kernel.exit(0)
end

def shut_up
@options[:snippets] = false
@options[:source] = false
Expand Down

0 comments on commit 3a27fa1

Please sign in to comment.