summaryrefslogtreecommitdiff
path: root/headers.lua
blob: 62542051ed53d9cdfe67b04ee79b26861928e5db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env lua
local args = require "pl.lapp" [[
Prints list of headers from one or more standards
	-d  (optional string)  Path to a custom standard definitions directory
	<selection...>  (optional string)  Standards to display the headers for
]]
local dir = require "pl.dir"
local parser = require "headers.db".parse_all(args.d)
if #args.selection > 0 then
	local headers = parser:get_headers(args.selection)
	if not headers then
		os.exit(1)
	end
	for _, header in pairs(headers) do
		print(header)
	end
	return
end
for _, tag in pairs(parser:get_tags()) do
	print(tag)
end