blob: a03f69a30d8e8ae6bd471edea6659dac64bdbd1a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
|