Files
2026-08-31 01:14:41 +02:00

5 lines
262 B
Crystal

# 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(","))