>From 0c75d97f72af7f1764657632a303b043ee6cf790 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 8 Jan 2012 02:29:24 +0100 Subject: [PATCH 2/4] Deprecate old option -P. * src/diff.c (UNIDIRECTIONAL_NEW_FILE_OPTION): New enumeration item. (longopts): Use it instead of '-P'. (main): Give an error message if option -P is used. --- src/diff.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/diff.c b/src/diff.c index 112c8c5..67b3109 100644 --- a/src/diff.c +++ b/src/diff.c @@ -130,6 +130,7 @@ enum SUPPRESS_COMMON_LINES_OPTION, TABSIZE_OPTION, TO_FILE_OPTION, + UNIDIRECTIONAL_NEW_FILE_OPTION, /* These options must be in sequence. */ UNCHANGED_LINE_FORMAT_OPTION, @@ -213,7 +214,7 @@ static struct option const longopts[] = {"to-file", 1, 0, TO_FILE_OPTION}, {"unchanged-group-format", 1, 0, UNCHANGED_GROUP_FORMAT_OPTION}, {"unchanged-line-format", 1, 0, UNCHANGED_LINE_FORMAT_OPTION}, - {"unidirectional-new-file", 0, 0, 'P'}, + {"unidirectional-new-file", 0, 0, UNIDIRECTIONAL_NEW_FILE_OPTION}, {"unified", 2, 0, 'U'}, {"version", 0, 0, 'v'}, {"width", 1, 0, 'W'}, @@ -455,7 +456,7 @@ main (int argc, char **argv) break; case 'P': - unidirectional_new_file = true; + fatal ("option -P no longer supported, use --unidirectional-new-file for the old meaning"); break; case 'q': @@ -612,6 +613,10 @@ main (int argc, char **argv) specify_value (&to_file, optarg, "--to-file"); break; + case UNIDIRECTIONAL_NEW_FILE_OPTION: + unidirectional_new_file = true; + break; + case UNCHANGED_LINE_FORMAT_OPTION: case OLD_LINE_FORMAT_OPTION: case NEW_LINE_FORMAT_OPTION: -- 1.6.3.2