summary refs log tree commit diff
path: root/bin/bacon
diff options
context:
space:
mode:
Diffstat (limited to 'bin/bacon')
-rwxr-xr-xbin/bacon9
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/bacon b/bin/bacon
index ad70263..cc3a08c 100755
--- a/bin/bacon
+++ b/bin/bacon
@@ -45,10 +45,15 @@ opts = OptionParser.new("", 24, '  ') { |opts|
   opts.on("-q", "--quiet",   "do Test::Unit-like non-verbose output") {
     output = 'TestUnitOutput'
   }
-  opts.on("-p", "--tap",   "do TAP (Test Anything Protocol) output") {
+  opts.on("-p", "--tap",     "do TAP (Test Anything Protocol) output") {
     output = 'TapOutput'
   }
 
+  opts.on("-o", "--output FORMAT",
+          "do FORMAT (SpecDox/TestUnit/Tap) output") { |format|
+    output = format + "Output" 
+  }
+
   opts.on("-a", "--automatic", "gather tests from ./test/, include ./lib/") {
     $LOAD_PATH.unshift "lib"  if File.directory? "lib"
     automatic = true
@@ -96,7 +101,7 @@ end
 
 require 'bacon'
 
-Bacon.extend Bacon.const_get(output)
+Bacon.extend Bacon.const_get(output) rescue abort "No such formatter: #{output}"
 Bacon.summary_on_exit
 
 files.each { |file|