Software / code / prosody
File
util/xpcall.lua @ 9780:c7727c13260f
prosodyctl: Pass the original argv table to subcommands (with first argument removed)
This preserves eg arg[-1] where you might find the path to the Lua
executable, which can be useful.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 10 Jan 2019 14:54:34 +0100 |
| parent | 9561:cfc7b2f7251e |
| child | 12975:d10957394a3c |
line wrap: on
line source
local xpcall = xpcall; if select(2, xpcall(function (x) return x end, function () end, "test")) ~= "test" then xpcall = require"util.compat".xpcall; end return { xpcall = xpcall; };