255: def formatters
256: on("-f", "--format", "FORMAT",
257: "Formatter for reporting, where FORMAT is one of:") do |o|
258: case o
259: when 's', 'spec', 'specdoc'
260: config[:formatter] = SpecdocFormatter
261: when 'h', 'html'
262: config[:formatter] = HtmlFormatter
263: when 'd', 'dot', 'dotted'
264: config[:formatter] = DottedFormatter
265: when 'b', 'describe'
266: config[:formatter] = DescribeFormatter
267: when 'f', 'file'
268: config[:formatter] = FileFormatter
269: when 'u', 'unit', 'unitdiff'
270: config[:formatter] = UnitdiffFormatter
271: when 'm', 'summary'
272: config[:formatter] = SummaryFormatter
273: when 'a', '*', 'spin'
274: config[:formatter] = SpinnerFormatter
275: when 't', 'method'
276: config[:formatter] = MethodFormatter
277: when 'y', 'yaml'
278: config[:formatter] = YamlFormatter
279: else
280: puts "Unknown format: #{o}"
281: puts @parser
282: exit
283: end
284: end
285:
286: doc ""
287: doc " s, spec, specdoc SpecdocFormatter"
288: doc " h, html, HtmlFormatter"
289: doc " d, dot, dotted DottedFormatter"
290: doc " f, file FileFormatter"
291: doc " u, unit, unitdiff UnitdiffFormatter"
292: doc " m, summary SummaryFormatter"
293: doc " a, *, spin SpinnerFormatter"
294: doc " t, method MethodFormatter"
295: doc " y, yaml YamlFormatter\n"
296:
297: on("-o", "--output", "FILE",
298: "Write formatter output to FILE") do |f|
299: config[:output] = f
300: end
301: end