From 93aa9ca807fd263059df50406abe033f24846b31 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 1 Feb 2023 00:50:21 +0800 Subject: show checker info --- xmake/plugins/check/main.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/xmake/plugins/check/main.lua b/xmake/plugins/check/main.lua index 4e862a6ad..3e411ff54 100644 --- a/xmake/plugins/check/main.lua +++ b/xmake/plugins/check/main.lua @@ -34,13 +34,26 @@ function _show_list() table.insert(tbl, {groupname:sub(1, 1):upper() .. groupname:sub(2) .. " checkers:"}) groups[groupname] = true end - table.insert(tbl, {{" " .. name, style = "${color.dump.string}"}, info.description}) + table.insert(tbl, {{" " .. name, style = "${color.dump.string_quote}"}, info.description}) end cprint(text.table(tbl)) end +function _show_info(name) + local checkers = checker.checkers() + local info = checkers[name] + if info then + cprint("${color.dump.string}checker${clear}(%s):", name) + cprint(" -> ${color.dump.string_quote}description${clear}: %s", info.description) + else + raise("checker(%s) not found!", name) + end +end + function main() if option.get("list") then return _show_list() + elseif option.get("info") then + return _show_info(option.get("info")) end end -- cgit v1.3.1