comparison mcabber/src/main.c @ 1256:ea679e3598a9

Don't start when command line options are wrong (Suggested by Wolfram)
author Mikael Berthe <mikael@lilotux.net>
date Tue, 26 Jun 2007 19:16:15 +0200
parents eb38963e082f
children 05dc45e7c7bb
comparison
equal deleted inserted replaced
1255:ceada40bbe20 1256:ea679e3598a9
322 if (c == -1) { 322 if (c == -1) {
323 break; 323 break;
324 } else 324 } else
325 switch (c) { 325 switch (c) {
326 case 'h': 326 case 'h':
327 case '?':
327 printf("Usage: %s [-f mcabberrc_file]\n\n", argv[0]); 328 printf("Usage: %s [-f mcabberrc_file]\n\n", argv[0]);
328 printf("Thanks to AjMacias for cabber!\n\n"); 329 return (c == 'h' ? 0 : -1);
329 return 0;
330 case 'f': 330 case 'f':
331 configFile = g_strdup(optarg); 331 configFile = g_strdup(optarg);
332 break; 332 break;
333 } 333 }
334 }
335
336 if (optind < argc) {
337 fprintf(stderr, "Usage: %s [-f mcabberrc_file]\n\n", argv[0]);
338 return -1;
334 } 339 }
335 340
336 /* Initialize command system, roster and default key bindings */ 341 /* Initialize command system, roster and default key bindings */
337 cmd_init(); 342 cmd_init();
338 roster_init(); 343 roster_init();