1
默认使用stdout指定输出文件的最佳方式是什么?trollop输出文件默认使用stdout
现在我想:
opts = Trollop::options do
opt :output, "Output File", :default => $stdout
opt :input, "Input File", :default => $stdin
end
但是当我尝试使用它,我得到:
$ ./test.rb -o temp.txt
Error: file or url for option '-o' cannot be opened: No such file or directory - temp.txt.
Try --help for help.
很显然,我不想要求输出文件之前存在运行我的脚本。
(还有,就是我指定的输入行不行呀?)