Skip to content

Commit

Permalink
build the command we execute from an array, provide option to output …
Browse files Browse the repository at this point in the history
…in pretty format
  • Loading branch information
auxesis committed Nov 18, 2009
1 parent f7ab239 commit e7dd149
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions lib/generators/project/bin/cucumber-nagios
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,21 @@ unless File.exist?(feature)
exit 98
end

command = "#{__DIR__}/cucumber"
command += " --require features/"
command += " --format Cucumber::Formatter::Nagios"
command += " #{feature}"
command_parts = []
command_parts << "#{__DIR__}/cucumber"
command_parts << "--require features/"

if ARGV.grep(/^\-\-pretty$/).size > 0
command_parts << "--format pretty"
else
command_parts << "--format Cucumber::Formatter::Nagios"
end

command_parts << feature
command = command_parts.join(' ')

if ARGV[1] == "--debug"
puts command
if ARGV.grep(/^\-\-debug$/).size > 0
puts command
puts
end

Expand Down

0 comments on commit e7dd149

Please sign in to comment.