From 4b316fb1650428930bcc6d40497f4e11de80561d Mon Sep 17 00:00:00 2001 From: A2va <49582555+A2va@users.noreply.github.com> Date: Thu, 15 Jun 2023 09:58:32 +0200 Subject: Display policies list in show plugin --- xmake/plugins/show/lists/policies.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 xmake/plugins/show/lists/policies.lua diff --git a/xmake/plugins/show/lists/policies.lua b/xmake/plugins/show/lists/policies.lua new file mode 100644 index 000000000..425b95026 --- /dev/null +++ b/xmake/plugins/show/lists/policies.lua @@ -0,0 +1,33 @@ +--!A cross-platform build utility based on Lua +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- +-- Copyright (C) 2015-present, TBOOX Open Source Group. +-- +-- @author ruki +-- @file envs.lua +-- + +-- imports +import("core.project.policy") + +-- show all policies +function main() + local policies = policy.policies() + local width = 45 + + for name, policy in pairs(policies) do + cprint("${color.dump.string}%s${clear}%s%s", name, (" "):rep(width - #name), policy["description"]) + cprint("%s${bright}%s", (" "):rep(width), policy["default"] or "false") + end +end -- cgit v1.3.1 From abce659c736b10d94401029dedd6b942ce786f3f Mon Sep 17 00:00:00 2001 From: A2va <49582555+A2va@users.noreply.github.com> Date: Thu, 15 Jun 2023 12:02:20 +0200 Subject: Modify header --- xmake/plugins/show/lists/policies.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xmake/plugins/show/lists/policies.lua b/xmake/plugins/show/lists/policies.lua index 425b95026..f341ad9b2 100644 --- a/xmake/plugins/show/lists/policies.lua +++ b/xmake/plugins/show/lists/policies.lua @@ -14,8 +14,8 @@ -- -- Copyright (C) 2015-present, TBOOX Open Source Group. -- --- @author ruki --- @file envs.lua +-- @author A2va +-- @file policies.lua -- -- imports -- cgit v1.3.1