diff options
author | ubq323 <ubq323@ubq323.website> | 2024-03-30 21:13:15 +0000 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2024-03-30 21:13:15 +0000 |
commit | 9f3f88a6ee7b9bd8ab3168d96a81b40e23024cc6 (patch) | |
tree | 232f11f4f4e68a9711cbdbfd59b13d2184f9bdf1 | |
parent | 8a5bc10b58aeec61a5d8b58e3aa31614c80a2655 (diff) |
add test.lua
-rw-r--r-- | test.lua | 19 |
1 files changed, 19 insertions, 0 deletions
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 |