#!/usr/bin/env luajit -- SPDX-License-Identifier: GPL-3.0-or-later cli_bin = 'kresd -q -c -' -- Work around OS X stripping dyld variables libdir = os.getenv('DYLD_LIBRARY_PATH') if libdir then cli_bin = string.format('DYLD_LIBRARY_PATH="%s" %s', libdir, cli_bin) end cli_cmd = [[echo ' option("ALWAYS_CUT", true) %s return resolve("%s", kres.type.%s, kres.class.%s, 0, function (pkt, req) local ok, err = pcall(function () %s end) if not ok then print(err) end quit() end)']] -- Parse CLI arguments local function help() name = 'kresd-query.lua' print(string.format('Usage: %s [-t type] [-c class] [-C config]