File: cvschpretty.lua

package info (click to toggle)
freepops 0.2.9-4.2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 6,284 kB
  • ctags: 2,684
  • sloc: ansic: 16,605; sh: 1,797; makefile: 1,369; cpp: 353
file content (29 lines) | stat: -rwxr-xr-x 631 bytes parent folder | download | duplicates (3)
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
26
27
28
29
#!/usr/bin/lua

comments = {}

for l in io.stdin:lines() do
	--print("processo ", l)
	local fname = string.match(l,"- ([^:]*):")	
	local comment = string.match(l,"- [^:]*:(.*)")
	--print("ottengo" , fname, comment)
	if comment and fname and fname ~= 'ChangeLog' then
		if comments[comment] == nil then
			comments[comment] = {fname}
		else
			table.insert(comments[comment],fname)
		end
	end
end

lines = {}

for k,v in pairs(comments) do
	table.sort(v)
	filename = table.concat(v,", ")
	k = string.gsub(k,"  "," ")
	table.insert(lines, "- " .. filename .. ":" .. k)
end

table.sort(lines)
for _,l in ipairs(lines) do print(l) end