summaryrefslogtreecommitdiff
path: root/generate.lua
diff options
context:
space:
mode:
Diffstat (limited to 'generate.lua')
-rwxr-xr-xgenerate.lua17
1 files changed, 16 insertions, 1 deletions
diff --git a/generate.lua b/generate.lua
index 478bc9d..bc46585 100755
--- a/generate.lua
+++ b/generate.lua
@@ -4,6 +4,8 @@ Generates activity chart
-f (string default 'ansi') Output format of the chart
-y (optional number) Year of the chart
-R Generate rolling chart
+ -A... (optional string) Author e-mail addresses to include in chart
+ -C... (optional string) Committer e-mail addresses to include in chart
<repos...> (optional string) Paths to repositories with activity
]]
local generators = require "activity.generators"
@@ -18,4 +20,17 @@ local maybe_year = args.y
if args.R then
maybe_year = "rolling"
end
-io.write(generators.generate_table(maybe_year, git.lookup(args.repos), maybe_format))
+local filter, by_author, by_committer
+if #args.A > 0 then
+ by_author = git.any_value_filter("author", args.A)
+end
+if #args.C > 0 then
+ by_committer = git.any_value_filter("committer", args.C)
+end
+if by_committer and by_author then
+ function filter (entry)
+ return by_author(entry) or by_committer(entry)
+ end
+end
+filter = filter or by_author or by_committer
+io.write(generators.generate_table(maybe_year, git.lookup(args.repos, filter), maybe_format))