summaryrefslogtreecommitdiff
path: root/generate.lua
blob: 9bbfc09bc45526e5b4962e90c75b1d0bb43767af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/lua
local args = require "pl.lapp" [[
Generates activity chart
	-f  (string default 'ansi')    Output format of the chart
	-y  (optional number)          Year of the chart
	<repos...>  (optional string)  Paths to repositories with activity
]]
local activity = require "activity"
local ok, maybe_format = pcall(require, "activity.formats." .. args.f)
if not ok then
	io.stderr:write(("couldn't find specified format: %q\n"):format(args.f))
	os.exit(1)
end
io.write(activity.generate_table(args.y, args.repos, maybe_format))