summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA2va <[email protected]>2023-06-15 09:58:32 +0200
committerA2va <[email protected]>2023-06-15 09:58:32 +0200
commit4b316fb1650428930bcc6d40497f4e11de80561d (patch)
treeb1474f31a265738857f07c5a54c9919db534e836
parent9379eb4c47b1bdece36b6f59061c4b1c1ce08b49 (diff)
Display policies list in show plugin
-rw-r--r--xmake/plugins/show/lists/policies.lua33
1 files changed, 33 insertions, 0 deletions
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