local label, heading = arg[1] or "-", arg[2] or ""
local function flavour()
if require == nil then
return "absent"
elseif package == nil then
return "confined"
end
return "native"
end
local function parent_target()
if require == nil then
return "there is no require to call"
end
local ok, err = pcall(require, "../secrets")
if ok then
return "loaded it"
elseif string.find(tostring(err), "invalid require target", 1, true) then
return "refused, the name is unrepresentable"
end
return "searched for it as a path"
end
local configurable = package ~= nil
if heading ~= "" then
print(heading)
end
print(string.format(
'%-8s require=%-8s package=%-3s searchers=%d require("../secrets"): %s',
label,
flavour(),
configurable and "yes" or "no",
configurable and #package.searchers or 0,
parent_target()
))