Sat, 14 Nov 2020 15:36:16 +0100
clix.raw: Import verse, don't rely on globals
return function (opts, arg) if opts.short_help then print("Query for the software of a client/server"); return; end if #arg == 0 or opts.help then return 0; end local conn; local function on_reply(reply) if not reply.error then if reply.name then print("Software:", reply.name); end if reply.version then print("Version:", reply.version); end if reply.platform then print("Platform:", reply.platform); end else print("Error requesting version ("..(reply.condition or "unknown")..")"..(reply.text and (": "..reply.text) or "")); end conn:close(); end local function on_connect(_conn) conn = _conn; conn:add_plugin("version"); conn:query_version(arg[1], on_reply); end clix_connect(opts, on_connect); end