jille_Jr icon

CC: which.lua

jille_Jr | PRO | 11/15/20 03:55:09 PM UTC | 0 ⭐ | 911 👁️ | Never ⏰ | []
Lua |

280 B

|

None

|

0 👍

/

0 👎

local args = {...}
 
if #args == 0 then
    error("usage: which <program>", 0)
end
 
local result = shell.resolveProgram(args[1])
 
if result == nil then
    error(table.concat {
        '"',
        args[1],
        '" not found'
    }, 0)
end
 
write '/'
print(result)

Comments