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

后端 未结 5 714
梦如初夏
梦如初夏 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 16:39

    Check the file association. Especially in the advanced settings look at the "Open" action. Make sure that there is a %* on the end of the action.

    This question is about powershell, but it is essentially the same question so my answer there should give a little more detail.

提交回复
热议问题