- else if (!strcmp(argv[1], "-z"))
- diff_output_format = DIFF_FORMAT_MACHINE;
- else if (!strcmp(argv[1], "-R"))
- diff_setup_opt |= DIFF_SETUP_REVERSE;
- else if (!strncmp(argv[1], "-S", 2))
- pickaxe = argv[1] + 2;
- else if (!strncmp(argv[1], "-O", 2))
- orderfile = argv[1] + 2;
- else if (!strcmp(argv[1], "--pickaxe-all"))
- pickaxe_opts = DIFF_PICKAXE_ALL;
- else if (!strncmp(argv[1], "-B", 2))
- diff_break_opt = diff_scoreopt_parse(argv[1]);
- else if (!strncmp(argv[1], "-M", 2)) {
- diff_score_opt = diff_scoreopt_parse(argv[1]);
- detect_rename = DIFF_DETECT_RENAME;
- }
- else if (!strncmp(argv[1], "-C", 2)) {
- diff_score_opt = diff_scoreopt_parse(argv[1]);
- detect_rename = DIFF_DETECT_COPY;
+ else {
+ int diff_opt_cnt;
+ diff_opt_cnt = diff_opt_parse(&diff_options,
+ argv+1, argc-1);
+ if (diff_opt_cnt < 0)
+ usage(diff_files_usage);
+ else if (diff_opt_cnt) {
+ argv += diff_opt_cnt;
+ argc -= diff_opt_cnt;
+ continue;
+ }
+ else
+ usage(diff_files_usage);