comparison lwlib/lw_cmdline.c @ 54:2077b755b8b4

Removed extraneous debugging statements from long option parsing routines
author lost@l-w.ca
date Tue, 05 Apr 2011 21:50:23 -0600
parents 51c840679a0e
children 8b0be0fc42cf
comparison
equal deleted inserted replaced
53:cb4efc47ce9d 54:2077b755b8b4
411 goto do_usage; 411 goto do_usage;
412 if (strcmp(argv[i], "--version") == 0) 412 if (strcmp(argv[i], "--version") == 0)
413 goto do_version; 413 goto do_version;
414 /* look up name */ 414 /* look up name */
415 415
416 fprintf(stderr, "option string: %s\n", argv[i]);
417 for (j = 2; argv[i][j] && argv[i][j] != '='; j++) 416 for (j = 2; argv[i][j] && argv[i][j] != '='; j++)
418 /* do nothing */ ; 417 /* do nothing */ ;
419 tstr = lw_alloc(j - 1); 418 tstr = lw_alloc(j - 1);
420 strncpy(tstr, argv[i] + 2, j - 2); 419 strncpy(tstr, argv[i] + 2, j - 2);
421 tstr[j - 2] = 0; 420 tstr[j - 2] = 0;
422 if (argv[i][j] == '=') 421 if (argv[i][j] == '=')
423 j++; 422 j++;
424 cch = j; 423 cch = j;
425 fprintf(stderr, "Option: %s, Arg: %s\n", tstr, argv[i]+j);
426 for (j = 0; parser -> options[j].name; j++) 424 for (j = 0; parser -> options[j].name; j++)
427 { 425 {
428 if (strcmp(parser -> options[j].name, tstr) == 0) 426 if (strcmp(parser -> options[j].name, tstr) == 0)
429 break; 427 break;
430 } 428 }