#!/usr/bin/env ruby require 'optparse' require_relative '../test/tool/test_builder' options = {} OptionParser.new do |opt| opt.banner = 'Usage: bin/gentest [file] [option]' opt.on('-m METHOD', 'Method name in the test file') do |m| options[:method] = m end opt.on('-c CLASS', 'Class name in the test file') do |c| options[:class] = c end opt.on('--open=FRONTEND', 'Start remote debugging with opening the network port.', 'Currently, only vscode is supported.') do |f| options[:open] = f.downcase end opt.parse!(ARGV) end exit if ARGV.empty? if options[:open] == 'vscode' DEBUGGER__::DAPTestBuilder.new(ARGV, options[:method], options[:class]).start else DEBUGGER__::LocalTestBuilder.new(ARGV, options[:method], options[:class]).start end