Simplify command-line arguments
authorCarl Worth <cworth@cworth.org>
Sun, 6 Jan 2008 06:02:42 +0000 (22:02 -0800)
committerCarl Worth <cworth@cworth.org>
Sun, 6 Jan 2008 06:02:42 +0000 (22:02 -0800)
lm-echo.c

index 1783197d9a9da9809430f7d063efb526cafbf574..687ac3ce4b004a5e16151ec57f7ecbaced031460 100644 (file)
--- a/lm-echo.c
+++ b/lm-echo.c
@@ -135,19 +135,17 @@ main (int argc, char **argv)
     msg_data_t       data;
     GError          *error;
 
-    if (argc < 6) {
-       g_print ("Usage: %s <server> <username> <password> <connectserver> <connectport>\n", argv[0]);
+    if (argc != 4) {
+       g_print ("Usage: %s <server> <username> <password>\n", argv[0]);
        return 1;
     }
                                                                                 
-    connection = lm_connection_new (argv[4]);
+    connection = lm_connection_new (argv[1]);
 
     jid = g_strdup_printf ("%s@%s", argv[2], argv[1]);
     lm_connection_set_jid (connection, jid);
     g_free (jid);
 
-    lm_connection_set_port (connection, strtol (argv[5], (char **) NULL, 10));
-
     data.main_loop = g_main_loop_new (NULL, FALSE);
 
     handler = lm_message_handler_new (handle_messages, &data, NULL);