Add -help flag for information on usage and options

Sat, 08 May 2010 19:28:19 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Sat, 08 May 2010 19:28:19 +0100
changeset 3
fb9987d6df5d
parent 2
1eabe33d7af7
child 4
0677d0506878

Add -help flag for information on usage and options

xmpp-fingerprint.lua file | annotate | diff | comparison | revisions
--- a/xmpp-fingerprint.lua	Fri Apr 23 14:32:28 2010 +0100
+++ b/xmpp-fingerprint.lua	Sat May 08 19:28:19 2010 +0100
@@ -35,6 +35,25 @@
 	return 1;
 end
 
+function flags.help()
+	print("XMPP Server Fingerprinter");
+	print("(C) 2010 Matthew Wild. Licensed under the MIT/X11 License");
+	print("");
+	print("Syntax: "..arg[0].." [OPTIONS] ADDRESS [PORT]");
+	print("");
+	print("ADDRESS must be the network address or IP to connect to, SRV lookup");
+	print("is not supported.");
+	print("");
+	print("PORT is the port number to connect to. Defaults to 5222, or 5269 for");
+	print("server-to-server testing.");
+	print("");
+	print("Options:");
+	print("    -s:", "Server-to-server port testing (less reliable)");
+	print("-t NUM:", "Set timeout to NUM seconds");
+	print("    -d:", "Enable debug output (useful for adding new fingerprints)");
+	print("");
+end
+
 -- Process flags --
 local function process_args(arg)
 	local f = arg[1] and arg[1]:match("^%-(%S+)");

mercurial