clix/version.lua

Mon, 16 Nov 2020 17:16:01 +0100

author
Kim Alvefur <zash@zash.se>
date
Mon, 16 Nov 2020 17:16:01 +0100
changeset 142
05ec7103c0f7
parent 27
5b58c002d6ad
permissions
-rw-r--r--

clix.watch_pep: Include short names for some common PEP nodes

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

mercurial