Ruby's ARGV can be empty on windows depending on a way to run script

后端 未结 5 655
梦如初夏
梦如初夏 2021-01-12 16:27

My demo.rb:

puts ARGV.size

ARGV.each do |a|
  puts \"Argument: #{a}\"
end

The result depends on how we run a script:

>          


        
5条回答
  •  时光说笑
    2021-01-12 17:06

    C:\Temp> ftype | grep ruby
    rbFile="c:\opt\ruby\bin\ruby.exe" "%1" %*
    rbwFile="c:\opt\ruby\bin\rubyw.exe" "%1" %*
    

提交回复
热议问题