exe/benchmark-driver in benchmark_driver-0.14.22 vs exe/benchmark-driver in benchmark_driver-0.15.0

- old
+ new

@@ -18,10 +18,23 @@ o.on('-r', '--runner TYPE', String, 'Specify runner type: ips, time, memory, once, block (default: ips)') do |d| c.runner_type = d end o.on('-o', '--output TYPE', String, 'Specify output type: compare, simple, markdown, record (default: compare)') do |out| c.output_type = out + begin + plugin_options = BenchmarkDriver::Output.get(out).const_get('OPTIONS', false) + rescue ArgumentError, LoadError, NameError + else + plugin_options.each do |name, args| + unless args.first.start_with?('--output-') + raise ArgumentError.new("#{args.first.dump} must start with '--output-'") + end + o.on(*args) do |opt| + c.output_opts[name] = opt + end + end + end end o.on('-e', '--executables EXECS', String, 'Ruby executables (e1::path1 arg1; e2::path2 arg2;...)') do |e| e.split(';').each do |name_path| name, path = name_path.split('::', 2) path ||= name # if `::` is not given, regard whole string as path @@ -32,10 +45,10 @@ end o.on('--rbenv VERSIONS', String, 'Ruby executables in rbenv (x.x.x arg1;y.y.y arg2;...)') do |r| r.split(';').each do |version| executables << BenchmarkDriver::Rbenv.parse_spec(version) end - end + end if system('which rbenv > /dev/null') o.on('--repeat-count NUM', Integer, 'Try benchmark NUM times and use the fastest result or the worst memory usage') do |v| c.repeat_count = v end o.on('--repeat-result TYPE', String, 'Yield "best", "average" or "worst" result with --repeat-count (default: best)') do |v| unless BenchmarkDriver::Repeater::VALID_TYPES.include?(v)