Warn and exit when no JID is supplied

Sat, 18 Sep 2010 18:35:32 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Sat, 18 Sep 2010 18:35:32 +0100
changeset 1
ce892ac8bec2
parent 0
d17a1b659852
child 2
b89fe0449b96

Warn and exit when no JID is supplied

capscan.lua file | annotate | diff | comparison | revisions
--- a/capscan.lua	Sat Sep 18 18:19:37 2010 +0100
+++ b/capscan.lua	Sat Sep 18 18:35:32 2010 +0100
@@ -13,6 +13,11 @@
 local xmlns_caps = "http://jabber.org/protocol/caps";
 local xmlns_disco = "http://jabber.org/protocol/disco#info";
 
+if not jid then
+	io.write("Please give a JID as the first argument\n");
+	os.exit(1);
+end
+
 if not pass then
 	io.write("Password (not blanked): ");
 	pass = io.read("*l");

mercurial