summaryrefslogtreecommitdiff
path: root/xmake/plugins
diff options
context:
space:
mode:
authorruki <[email protected]>2020-06-20 22:12:37 +0800
committerruki <[email protected]>2020-06-20 22:12:37 +0800
commit5344ee211d80f85b32607750b9c5443ef9662f40 (patch)
tree94eec1241e36fe804bc732dd4390d43bb4fbc44d /xmake/plugins
parent17561f833fe7dba0721cfd8f48a88213867231a0 (diff)
add xmake show -l envs
Diffstat (limited to 'xmake/plugins')
-rw-r--r--xmake/plugins/show/lists/envs.lua42
1 files changed, 42 insertions, 0 deletions
diff --git a/xmake/plugins/show/lists/envs.lua b/xmake/plugins/show/lists/envs.lua
new file mode 100644
index 000000000..18fbed14b
--- /dev/null
+++ b/xmake/plugins/show/lists/envs.lua
@@ -0,0 +1,42 @@
+--!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-2020, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file envs.lua
+--
+
+-- imports
+import("core.base.text")
+import("core.base.global")
+import("core.project.config")
+
+-- show all toolchains
+function main()
+
+ local envs = { XMAKE_PROGRAM_DIR = {"Set the program scripts directory of xmake.", os.programdir()},
+ XMAKE_CONFIGDIR = {"Set the local config directory of project.", config.directory()},
+ XMAKE_GLOBALDIR = {"Set the global config directory of xmake.", global.directory()},
+ XMAKE_COLORTERM = {"Set the color terminal environment.", os.getenv("XMAKE_COLORTERM") or os.getenv("COLORTERM")},
+ XMAKE_LOGFILE = {"Set the log output file path.", os.getenv("XMAKE_LOGFILE")},
+ XMAKE_ROOT = {"Allow xmake to run under root.", os.getenv("XMAKE_ROOT")},
+ XMAKE_RAMDIR = {"Set the ramdisk directory.", os.getenv("XMAKE_RAMDIR")},
+ XMAKE_TMPDIR = {"Set the temporary directory.", os.tmpdir()}}
+ local width = 24
+ for name, env in pairs(envs) do
+ cprint("${color.dump.string}%s${clear}%s%s", name, (" "):rep(width - #name), env[1])
+ cprint("%s${bright}%s", (" "):rep(width), env[2] or "<empty>")
+ end
+end