aboutsummaryrefslogtreecommitdiffstats
path: root/testing/aaudit/aaudit-repo-update
blob: 3aa4cc5854ae84ea9481dccb37db13956c62a68c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/lua5.2

local posix = require 'posix'
local aaudit = require 'aaudit'

local function usage()
	print("usage: aaudit-repo-update [-i COMMIT_IDENTITY] [-m COMMIT_MESSAGE]")
	os.exit(1)
end

local C = { }
local address
for ret, optval in posix.getopt(arg, 'a:i:m:') do
	if ret == 'a' then
		address = optval
	elseif ret == 'i' then
		C.identity = optval
	elseif ret == 'm' then
		C.message = optval
	else
		usage()
	end
end

aaudit.import_commit(aaudit.repohome(address), C)