sources/main.cpp

changeset 30
21fba5183768
parent 27
089e37c0887e
child 31
b5b5a6a96d91
--- a/sources/main.cpp	Mon Dec 15 02:03:08 2014 +0200
+++ b/sources/main.cpp	Mon Dec 15 02:15:09 2014 +0200
@@ -43,8 +43,18 @@
 main (int argc, char* argv[]) -> int
 {
 	HUFFMAN_Construct();
+
+	if (argc != 1 and argc != 3)
+	{
+		fprintf (stderr, "usage: %s\nusage: %s <address> <password>\n", argv[0], argv[0]);
+		return EXIT_FAILURE;
+	}
+
 	Interface::initialize();
 
+	if (argc == 3)
+		Interface::connect (argv[1], argv[2]);
+
 	try
 	{
 		for (;;)

mercurial