我正在尝试使用OptionParser来读取多个选项,并让它们都作用于一个文件名。 Ex: myprogram.rb -a -b file.txt如何让2个选项共享一个强制性参数,同时允许像-h这样的东西在没有参数的情况下运行?目前上面的行只是让-a以-b为参数。 optionparser.on("-a FILENAME", "Do this") do |a|
puts a
end
如果我使用的文件名,而不是options[:config_file]它打印文件的线条,符合市场预期,我通过命令行选项从文件试图打印线 no implicit conversion of true into String (TypeError)
from threat_detection.rb:64:in 'new'
from threat_detection.rb:64:in '<main>'