clix/sendfile.lua

Mon, 23 Nov 2020 23:52:31 +0100

author
Kim Alvefur <zash@zash.se>
date
Mon, 23 Nov 2020 23:52:31 +0100
changeset 145
6e05b25c2669
parent 47
d4650cc6bb3f
permissions
-rw-r--r--

clix.watch_pep: Move invocation syntax out of short help

So it doesn't clutter the command listing

return function (opts, arg)
	if opts.short_help then
		print("Send a file");
		return;
	end
	if (#arg == 0 or opts.help) and not opts.interactive then
		return 0;
	end
	local function on_connect(conn)
		conn:hook("proxy65/discovered-proxies", function ()
			conn:debug("Sending %s to %s", arg[2], arg[1]);
			conn:send_file(arg[1], arg[2]);
		end);
	end
	clix_connect(opts, on_connect, { "disco", "proxy65", "jingle", "jingle_ft", "jingle_s5b" });
end

mercurial