summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-03-30 21:13:15 +0000
committerubq323 <ubq323@ubq323.website>2024-03-30 21:13:15 +0000
commit9f3f88a6ee7b9bd8ab3168d96a81b40e23024cc6 (patch)
tree232f11f4f4e68a9711cbdbfd59b13d2184f9bdf1
parent8a5bc10b58aeec61a5d8b58e3aa31614c80a2655 (diff)
add test.lua
-rw-r--r--test.lua19
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