- for (i = 0; i < argc && argv[i][0] == '-'; i++) {
- if (STRNCMP_LITERAL (argv[i], "--verbose") == 0) {
- add_files_state.verbose = 1;
- } else if (strcmp (argv[i], "--debug") == 0) {
- add_files_state.debug = 1;
- } else if (strcmp (argv[i], "--no-hooks") == 0) {
- run_hooks = FALSE;
- } else {
- fprintf (stderr, "Unrecognized option: %s\n", argv[i]);
- return 1;
- }
- }
- config = notmuch_config_open (ctx, NULL, NULL);
- if (config == NULL)
+ opt_index = parse_arguments (argc, argv, options, 1);
+ if (opt_index < 0) {
+ /* diagnostics already printed */