summaryrefslogtreecommitdiff
path: root/test.lua
diff options
context:
space:
mode:
Diffstat (limited to '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