about summary refs log tree commit diff stats
path: root/main.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-02-26 17:59:04 +0000
committerJames Booth <boothj5@gmail.com>2012-02-26 17:59:04 +0000
commit72d96a92f3b912d1ddcf2a0fc494905782ef3fe9 (patch)
tree32d157bbd2c914da61d0fe4107b1b894d1430096 /main.c
parenta0e5cd28bba20e6620993703aaa189ab53f45d7e (diff)
downloadprofani-tty-72d96a92f3b912d1ddcf2a0fc494905782ef3fe9.tar.gz
Added -notls argument and removed server name hack
Added jabber_conn struct to represent connections
Diffstat (limited to 'main.c')
-rw-r--r--main.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/main.c b/main.c
index fd45aaa0..a9a8b6b8 100644
--- a/main.c
+++ b/main.c
@@ -20,16 +20,37 @@
  *
  */
 
+#include <stdio.h>
+#include <string.h>
+
 #include "log.h"
 #include "windows.h"
 #include "profanity.h"
 
-int main(void)
+int main(int argc, char **argv)
 {   
+    int disable_tls = 0;
+
+    // more than one argument
+    if (argc > 2) {
+        printf("Usage: profanity [-notls]\n");
+        return 1;
+
+    // argument is not -notls
+    } else if (argc == 2) {
+        char *arg1 = argv[1];
+        if (strcmp(arg1, "-notls") != 0) {
+            printf("Usage: profanity [-notls]\n");
+            return 1;
+        } else {
+            disable_tls = 1;
+        }
+    }
+
     log_init();
     gui_init();
 
-    profanity_main();
+    profanity_main(disable_tls);
         
     gui_close();
     log_close();