- for (i = 0; i < argc && argv[i][0] == '-'; i++) {
- if (strcmp (argv[i], "--") == 0) {
- i++;
- break;
- }
- if (STRNCMP_LITERAL (argv[i], "--output=") == 0) {
- const char *opt = argv[i] + sizeof ("--output=") - 1;
- if (strcmp (opt, "threads") == 0) {
- output_messages = FALSE;
- } else if (strcmp (opt, "messages") == 0) {
- output_messages = TRUE;
- } else {
- fprintf (stderr, "Invalid value for --output: %s\n", opt);
- return 1;
- }
- } else {
- fprintf (stderr, "Unrecognized option: %s\n", argv[i]);
- return 1;
- }
- }
+ opt_index = parse_arguments (argc, argv, options, 1);