if (sys.argv.len() < 2) {
	println("usage: wc.az file [file..]")
	sys.exit(0)
}
fileNames = os.glob([sys.argv[1..]]):list
lenMax = max(fileNames:*len())
nlinesSum = 0
for (fileName in fileNames) {
	nlines = open(fileName).readlines().len()
	printf("%-*s %d\n", lenMax, fileName, nlines)
	nlinesSum += nlines
}
printf("%d\n", nlinesSum)
