clix.watch_pep: Take PEP node as positional argument

Sun, 15 Nov 2020 20:45:50 +0100

author
Kim Alvefur <zash@zash.se>
date
Sun, 15 Nov 2020 20:45:50 +0100
changeset 140
8815232cbbeb
parent 139
6909e479c56b
child 141
93eda3dd85f7

clix.watch_pep: Take PEP node as positional argument

Thanks MattJ

clix/watch_pep.lua file | annotate | diff | comparison | revisions
--- a/clix/watch_pep.lua	Sun Nov 15 15:05:24 2020 +0100
+++ b/clix/watch_pep.lua	Sun Nov 15 20:45:50 2020 +0100
@@ -1,14 +1,14 @@
 local verse = require "verse";
 
 return function (opts, arg)
-	if opts.short_help then
+	if opts.short_help or not arg[1] then
 		print("Watches PEP notifications from all contacts")
-		print("clix watch_pep [--node PEP-NODE] [--noempty]")
+		print("clix watch_pep [--noempty] PEP-NODE")
 		return;
 	end
 
 	local function onconnect(conn)
-		conn:hook_pep(opts.node or "urn:xmpp:microblog:0", function (event)
+		conn:hook_pep(arg[1], function (event)
 			local payload = event.item;
 			if not payload then return end
 			if opts.noempty and not payload[1] then return end

mercurial