diff options
| author | ruki <[email protected]> | 2023-02-01 00:50:21 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-02-01 00:50:21 +0800 |
| commit | 93aa9ca807fd263059df50406abe033f24846b31 (patch) | |
| tree | d7b9fc3431a5bcbd4b19a012c654bbb74e3b0f33 /xmake/plugins/check/main.lua | |
| parent | c638e5b6111c919b46a676f7eefcc7fead324874 (diff) | |
show checker info
Diffstat (limited to 'xmake/plugins/check/main.lua')
| -rw-r--r-- | xmake/plugins/check/main.lua | 15 |
1 files changed, 14 insertions, 1 deletions
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 |
