diff options
Diffstat (limited to 'headers.lua')
-rwxr-xr-x | headers.lua | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/headers.lua b/headers.lua index 8726615..680142d 100755 --- a/headers.lua +++ b/headers.lua @@ -11,7 +11,18 @@ for _, filename in pairs(definitions) do local handle = io.open(filename) local data = handle:read("a") handle:close() - if parser:parse(data, args.selection) then - return -- interface is yet to be properly defined, this allows only for first-result queries + parser:parse(data) +end +if args.selection 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 |