所以我的问题基本上是如果找不到作为参数给出的文件,我无法找出给出错误消息的条件。
if ARGV.empty?
puts "Give me a file!"
elseif [condition]
puts "Can't find the file"
else
file = File.open(ARGV[0])
Run Code Online (Sandbox Code Playgroud)
我真正需要的是 elseif 的条件。
| 归档时间: |
|
| 查看次数: |
3348 次 |
| 最近记录: |