【发布时间】:2020-10-03 20:41:38
【问题描述】:
例如,当我在命令行中输入ruby file.rb -a "water the plants"
我希望将此行添加到哈希中。比如待办事项清单。
所以它看起来像item1: water the plants
这是我到目前为止所做的:
require 'optparse'
option_parser = OptionParser.new do |opts|
opts.on '-a', '--add',
end
提前致谢!
【问题讨论】: