# to generate a list of numbered urls in the style of example.com/1,example.com/2,... a = ARGV.index("-r") || abort("usage: urlgen -r A-B template") s, e = ARGV[a + 1].split('-').map(&.to_i) t = ARGV[a + 2] puts((s..e).map { |n| t.gsub("{}", n.to_s) }.join(","))