From 9f3f88a6ee7b9bd8ab3168d96a81b40e23024cc6 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sat, 30 Mar 2024 21:13:15 +0000 Subject: add test.lua --- test.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test.lua diff --git a/test.lua b/test.lua new file mode 100644 index 0000000..a03f69a --- /dev/null +++ b/test.lua @@ -0,0 +1,19 @@ +local n = 0 +local is_required = false +while true do + local x = debug.getinfo(n) + if x == nil then break end + n = n + 1 + if x.name == 'require' then + is_required = true + + break + end +end + +if is_required then + print("required") +else + print("cmdlined") + +end -- cgit v1.2.3