Ruby command line arguments ARGV


We already saw how to use

examples/intro/cli.rb
puts ARGV
puts "------"

puts ARGV[0]
puts ARGV[1]

puts "------"

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

$ ruby examples/intro/cli.rb a b d


a
b
d
------
a
b
------
Argument: a
Argument: b
Argument: d