From 830407e88f9d40d954356c3754f2647f91d5c06a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 17:26:00 +0200 Subject: Adding upstream version 5.6.0. Signed-off-by: Daniel Baumann --- scripts/kresd-query.lua | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 scripts/kresd-query.lua (limited to 'scripts/kresd-query.lua') diff --git a/scripts/kresd-query.lua b/scripts/kresd-query.lua new file mode 100755 index 0000000..713b9c7 --- /dev/null +++ b/scripts/kresd-query.lua @@ -0,0 +1,63 @@ +#!/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]