[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[wdiff-bugs] [PATCH] diff as input
From: |
Martin von Gagern |
Subject: |
[wdiff-bugs] [PATCH] diff as input |
Date: |
Thu, 02 Apr 2009 09:55:22 +0200 |
User-agent: |
Thunderbird 2.0.0.21 (X11/20090321) |
Martin von Gagern wrote:
> Hi!
>
> There are a lot of tools out there which produce (unified) diff as
> output. Examples are most revision control tools, like cvs, svn, hg,
> git, bzr, as well as other tools like quilt. There are cases where I
> would want to look at the changes using wdiff. Therefore I propose the
> introduction of a new flag, "-u", telling wdiff that the input is in
> unified diff format.
>
> wdiff could then create temporary files, copying lines starting with '-'
> only to the left one, those starting with '+' only to the right one, and
> all other lines to both. The first character should be stripped if it is
> '-', '+' or ' ' but probably kept if it is '@'. Then the normal
> operation could process those two input files.
>
> The result would of course not be the same as a wdiff of the whole
> original input files, as the unified diff contains only a limited amount
> of context information. Instead, the @@ lines separating hunks would
> still be visible, as would be the details about the files compared.
> wdiff would operate on those informations as well, which I would
> consider intended behaviour, but I'm not really sure.
>
> Any opinions on this before I start coding?
As I got no reply, I simply created the attached patch. I named the flag
"-d" resp. "--diff-input", as the mode of a diff can be autodetected, so
that if a future version of wdiff supports other diff formats as input,
it could reuse that flag.
The patch is written on top of my NonSeekableInput.patch from
https://savannah.gnu.org/bugs/index.php?25883 which I just posted to
this list as well. It factors out the creation of a temporary buffer
backed by a file to a separate function create_temporary_side.
The modification of the Usage description affects translations as well.
Therefore I included the POT in the patch, to exhibit this change,
although the file it is auto-generated. I also introduced an error
message for "Too many file arguments", which was incorrectly reported as
"Missing file arguments" before, and which is the only thing that can go
wrong with diff input, as zero arguments should use stdin, I think.
It would be nice to see this patch included in wdiff. I noticed that
there are other sources in the wdiff source tree whcih might be intended
as replacements one day, but as they crash on me, I didn't spend much
effort to adapt them for diff input as well.
Greetings,
Martin von Gagern
Index: wdiff/src/wdiff.c
===================================================================
--- wdiff.orig/src/wdiff.c
+++ wdiff/src/wdiff.c
@@ -117,6 +117,7 @@ struct option const longopts[] =
{"statistics" , 0, NULL, 's'},
{"terminal" , 0, NULL, 't'},
{"version" , 0, NULL, 'v'},
+ {"diff-input" , 0, NULL, 'd'},
{NULL , 0, NULL, 0}
};
@@ -125,6 +126,7 @@ const char *program_name; /* name of exe
int inhibit_left; /* inhibit display of left side words */
int inhibit_right; /* inhibit display of left side words */
int inhibit_common; /* inhibit display of common words */
+int diff_input; /* expect (unified) diff as input */
int ignore_case; /* ignore case in comparisons */
int show_statistics; /* if printing summary statistics */
int no_wrapping; /* end/restart strings at end of lines */
@@ -596,6 +598,86 @@ create_template_filename (char *tmpl, si
return tmpl;
}
+/*--------------------------------------------------.
+| Create a temporary file for one side of the diff. |
+`--------------------------------------------------*/
+static void
+create_temporary_side (SIDE *side)
+{
+ int fd; /* for file descriptors returned by mkstemp */
+
+ /* Select a file name, use it for opening a temporary file and
+ unlink it right away. We do not need the file name itself
+ anymore. */
+
+ if (create_template_filename (side->temp_name, L_tmpnam) == NULL)
+ error (EXIT_FAILURE, 0, _("No suitable temporary directory exists"));
+ if ((fd = mkstemp (side->temp_name)) == -1)
+ error (EXIT_FAILURE, errno, "%s", side->temp_name);
+
+ side->file = fdopen (fd, "w+");
+ if (side->file == NULL)
+ error (EXIT_FAILURE, errno, "%s", side->temp_name);
+ if (unlink (side->temp_name) != 0)
+ error (EXIT_FAILURE, errno, "%s", side->temp_name);
+}
+
+/*--------------------------------------------------------.
+| Read unified diff and produce two output files from it. |
+`--------------------------------------------------------*/
+
+static void
+split_diff (const char *path) {
+ FILE *input;
+ int character;
+ int start_of_line = 1;
+ int output_to = 3;
+
+ if (path == NULL)
+ {
+ input = stdin;
+ }
+ else
+ {
+ input = fopen(path, "r");
+ if (input == NULL)
+ error (EXIT_FAILURE, errno, "%s", path);
+ }
+
+ create_temporary_side (left_side);
+ create_temporary_side (right_side);
+
+ while ((character = getc (input)) != EOF)
+ {
+ if (start_of_line)
+ {
+ start_of_line = 0;
+ switch (character)
+ {
+ case '-':
+ output_to = 1;
+ continue;
+ case '+':
+ output_to = 2;
+ continue;
+ case ' ':
+ output_to = 3;
+ continue;
+ default:
+ output_to = 3;
+ break;
+ }
+ }
+ if (output_to & 1)
+ putc(character, left_side->file);
+ if (output_to & 2)
+ putc(character, right_side->file);
+ start_of_line = (character == '\n' || character == '\r');
+ }
+ rewind (left_side->file);
+ rewind (right_side->file);
+}
+
/*-------------------------------------------------------------------------.
| For a given SIDE, turn original input file in another one, in which each |
| word is on one line. |
@@ -610,6 +692,8 @@ split_file_into_words (SIDE *side)
/* Open files. */
+ if (!diff_input) {
+ /* TODO: Reindent this block later on. Keep patches clean for now. */
if (side->filename == NULL)
{
side->file = stdin;
@@ -631,27 +715,16 @@ split_file_into_words (SIDE *side)
if (fseek(side->file, 0L, SEEK_CUR) != 0)
{
/* Non-seekable input, e.g. stdin or shell process substitution.
- Select a file name, use it for opening a temporary file and
- unlink it right away. Then, copy the whole input to
- this temporary local file. Once done, prepare it for reading.
- We do not need the file name itself anymore. */
-
- if (create_template_filename (side->temp_name, L_tmpnam) == NULL)
- error (EXIT_FAILURE, 0, _("No suitable temporary directory exists"));
- if ((fd = mkstemp (side->temp_name)) == -1)
- error (EXIT_FAILURE, errno, "%s", side->temp_name);
-
+ Copy the whole input to a temporary local file. Once done,
+ prepare it for reading. */
input = side->file;
- side->file = fdopen (fd, "w+");
- if (side->file == NULL)
- error (EXIT_FAILURE, errno, "%s", side->temp_name);
- if (unlink (side->temp_name) != 0)
- error (EXIT_FAILURE, errno, "%s", side->temp_name);
+ create_temporary_side(side);
while (side->character = getc (input), side->character != EOF)
putc (side->character, side->file);
rewind (side->file);
}
+ }
side->character = getc (side->file);
side->position = 0;
@@ -1183,8 +1256,9 @@ wdiff - Compares words in two files and
stdout);
printf (_("\
\n\
-Usage: %s [OPTION]... FILE1 FILE2\n"),
- program_name);
+Usage: %s [OPTION]... FILE1 FILE2\n\
+ %s -d [OPTION]... [FILE]\n"),
+ program_name, program_name);
printf (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
\n\
@@ -1195,6 +1269,7 @@ Mandatory arguments to long options are
-3, --no-common inhibit output of common words\n"));
printf (_("\
-a, --auto-pager automatically calls a pager\n\
+ -d, --diff-input use single unified diff as input\n\
-h, --help print this help\n\
-i, --ignore-case fold character case while comparing\n\
-l, --less-mode variation of printer mode for \"less\"\n\
@@ -1236,6 +1311,7 @@ main (int argc, char *const argv[])
inhibit_right = 0;
inhibit_common = 0;
+ diff_input = 0;
ignore_case = 0;
show_statistics = 0;
no_wrapping = 0;
@@ -1262,7 +1338,7 @@ main (int argc, char *const argv[])
count_changed_right = 0;
while (option_char = getopt_long (argc, (char **) argv,
- "123CKahilnpstvw:x:y:z:", longopts, NULL),
+ "123CKadhilnpstvw:x:y:z:", longopts, NULL),
option_char != EOF)
switch (option_char)
{
@@ -1286,6 +1362,10 @@ main (int argc, char *const argv[])
autopager = 1;
break;
+ case 'd':
+ diff_input = 1;
+ break;
+
case 'h':
usage (EXIT_SUCCESS);
@@ -1362,12 +1442,6 @@ Written by Franc,ois Pinard <address@hidden
usage (EXIT_FAILURE);
}
- if (optind + 2 != argc)
- {
- error (0, 0, _("Missing file arguments"));
- usage (EXIT_FAILURE);
- }
-
/* If find_termcap still undecided, make it true only if autopager is set
while stdout is directed to a terminal. This decision might be
reversed later, if the pager happens to be "less". */
@@ -1377,6 +1451,32 @@ Written by Franc,ois Pinard <address@hidden
/* Setup file names and signals, then do it all. */
+ if (diff_input)
+ {
+ if (optind + 1 < argc)
+ {
+ error (0, 0, _("Too many file arguments"));
+ usage (EXIT_FAILURE);
+ }
+ if (optind == argc || strcmp (argv[optind], "") == 0 || strcmp
(argv[optind], "-") == 0)
+ split_diff (NULL);
+ else
+ split_diff (argv[optind]);
+ }
+ else
+ {
+ if (optind + 2 > argc)
+ {
+ error (0, 0, _("Missing file arguments"));
+ usage (EXIT_FAILURE);
+ }
+ if (optind + 2 < argc)
+ {
+ error (0, 0, _("Too many file arguments"));
+ usage (EXIT_FAILURE);
+ }
+
+ /* TODO: Reindent this block later on. Keep patches clean for now. */
if (strcmp (argv[optind], "") == 0 || strcmp (argv[optind], "-") == 0)
left_side->filename = NULL;
else
@@ -1393,6 +1493,7 @@ Written by Franc,ois Pinard <address@hidden
if (left_side->filename == NULL && right_side->filename == NULL)
error (EXIT_FAILURE, 0, _("Only one file may be standard input."));
+ }
setup_signals ();
input_file = NULL;
Index: wdiff/po/wdiff.pot
===================================================================
--- wdiff.orig/po/wdiff.pot
+++ wdiff/po/wdiff.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: address@hidden"
-"POT-Creation-Date: 2008-06-20 16:41-0400\n"
+"POT-Creation-Date: 2009-04-02 09:22+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <address@hidden>\n"
"Language-Team: LANGUAGE <address@hidden>\n"
@@ -16,121 +16,121 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: src/mdiff.c:398
+#: src/mdiff.c:397
#, c-format
msgid "%s (for regexp `%s')"
msgstr ""
-#: src/mdiff.c:917 src/wdiff.c:1388
+#: src/mdiff.c:916 src/wdiff.c:1495
msgid "Only one file may be standard input."
msgstr ""
-#: src/mdiff.c:932 src/wdiff.c:643
+#: src/mdiff.c:931 src/wdiff.c:709
msgid "Directories not supported"
msgstr ""
-#: src/mdiff.c:1075
+#: src/mdiff.c:1074
#, c-format
msgid "Reading %s"
msgstr ""
-#: src/mdiff.c:1198
+#: src/mdiff.c:1197
#, c-format
msgid ", %d items\n"
msgstr ""
-#: src/mdiff.c:1276
+#: src/mdiff.c:1275
#, c-format
msgid "Read summary: %d files, %d items\n"
msgstr ""
-#: src/mdiff.c:1671
+#: src/mdiff.c:1670
#, c-format
msgid "Sorting"
msgstr ""
-#: src/mdiff.c:1688
+#: src/mdiff.c:1687
#, c-format
msgid ", clustering"
msgstr ""
-#: src/mdiff.c:1857 src/mdiff.c:1920
+#: src/mdiff.c:1856 src/mdiff.c:1919
#, c-format
msgid ", done\n"
msgstr ""
-#: src/mdiff.c:1907
+#: src/mdiff.c:1906
#, c-format
msgid "Sorting members"
msgstr ""
-#: src/mdiff.c:1939
+#: src/mdiff.c:1938
#, c-format
msgid "Work summary: %d clusters, %d members\n"
msgstr ""
-#: src/mdiff.c:2317
+#: src/mdiff.c:2316
#, c-format
msgid "Work summary: %d clusters, %d members, %d overlaps\n"
msgstr ""
-#: src/mdiff.c:2372 src/wdiff.c:245
+#: src/mdiff.c:2371 src/wdiff.c:247
msgid "Select a terminal through the TERM environment variable."
msgstr ""
-#: src/mdiff.c:2375 src/wdiff.c:248
+#: src/mdiff.c:2374 src/wdiff.c:250
msgid "Could not access the termcap data base."
msgstr ""
-#: src/mdiff.c:2377 src/wdiff.c:250
+#: src/mdiff.c:2376 src/wdiff.c:252
#, c-format
msgid "Terminal type `%s' is not defined."
msgstr ""
-#: src/mdiff.c:3754 src/mdiff.c:3766 src/wdiff.c:1110 src/wdiff.c:1122
+#: src/mdiff.c:3753 src/mdiff.c:3765 src/wdiff.c:1190 src/wdiff.c:1202
#, c-format
msgid "%s: %d words"
msgstr ""
-#: src/mdiff.c:3757 src/mdiff.c:3769 src/wdiff.c:1113 src/wdiff.c:1125
+#: src/mdiff.c:3756 src/mdiff.c:3768 src/wdiff.c:1193 src/wdiff.c:1205
#, c-format
msgid " %d %d%% common"
msgstr ""
-#: src/mdiff.c:3759 src/wdiff.c:1115
+#: src/mdiff.c:3758 src/wdiff.c:1195
#, c-format
msgid " %d %d%% deleted"
msgstr ""
-#: src/mdiff.c:3761 src/mdiff.c:3773 src/wdiff.c:1117 src/wdiff.c:1129
+#: src/mdiff.c:3760 src/mdiff.c:3772 src/wdiff.c:1197 src/wdiff.c:1209
#, c-format
msgid " %d %d%% changed"
msgstr ""
-#: src/mdiff.c:3771 src/wdiff.c:1127
+#: src/mdiff.c:3770 src/wdiff.c:1207
#, c-format
msgid " %d %d%% inserted"
msgstr ""
-#: src/mdiff.c:3800 src/unify.c:272 src/wdiff.c:1170 src/wdiff2.c:177
+#: src/mdiff.c:3799 src/unify.c:272 src/wdiff.c:1250 src/wdiff2.c:177
#, c-format
msgid "Try `%s --help' for more information.\n"
msgstr ""
-#: src/mdiff.c:3804
+#: src/mdiff.c:3803
msgid ""
"mdiff - Studies multiple files and searches for similar sequences, it then\n"
"produces possibly detailed lists of differences and similarities.\n"
msgstr ""
-#: src/mdiff.c:3808
+#: src/mdiff.c:3807
#, c-format
msgid ""
"\n"
"Usage: %s [OPTION]... [FILE]...\n"
msgstr ""
-#: src/mdiff.c:3812
+#: src/mdiff.c:3811
msgid ""
"\n"
"Operation modes:\n"
@@ -140,7 +140,7 @@ msgid ""
" --version output version information and exit\n"
msgstr ""
-#: src/mdiff.c:3819
+#: src/mdiff.c:3818
msgid ""
"\n"
"Formatting output:\n"
@@ -151,14 +151,14 @@ msgid ""
" -t, --expand-tabs expand tabs to spaces in the output\n"
msgstr ""
-#: src/mdiff.c:3828
+#: src/mdiff.c:3827
msgid ""
"\n"
"Debugging:\n"
" -0, --debugging output many details about what is going on\n"
msgstr ""
-#: src/mdiff.c:3833
+#: src/mdiff.c:3832
msgid ""
"\n"
"Word mode options:\n"
@@ -175,7 +175,7 @@ msgid ""
" -W, --word-mode compare words instead of lines\n"
msgstr ""
-#: src/mdiff.c:3849
+#: src/mdiff.c:3848
msgid ""
"\n"
"Comparing files:\n"
@@ -186,7 +186,7 @@ msgid ""
"* --horizon-lines=LINES keep LINES lines in common prefixes/suffixes\n"
msgstr ""
-#: src/mdiff.c:3859
+#: src/mdiff.c:3858
msgid ""
"\n"
"Comparing directories:\n"
@@ -199,7 +199,7 @@ msgid ""
"* -x, --exclude=PATTERN ignore files (dirs) matching PATTERN\n"
msgstr ""
-#: src/mdiff.c:3871
+#: src/mdiff.c:3870
msgid ""
"\n"
"Ignoring text:\n"
@@ -210,7 +210,7 @@ msgid ""
" -w, --ignore-all-space ignore white space\n"
msgstr ""
-#: src/mdiff.c:3879
+#: src/mdiff.c:3878
msgid ""
"\n"
"Clustering:\n"
@@ -219,7 +219,7 @@ msgid ""
" -j, --ignore-delimiters do not count items having only delimiters\n"
msgstr ""
-#: src/mdiff.c:3887
+#: src/mdiff.c:3886
msgid ""
"\n"
"Detailed output formats:\n"
@@ -234,7 +234,7 @@ msgid ""
"* --line-format=FORMAT --{old,new,unchanged}-line-format\n"
msgstr ""
-#: src/mdiff.c:3901
+#: src/mdiff.c:3900
msgid ""
"\n"
"Script-like formats:\n"
@@ -244,7 +244,7 @@ msgid ""
"* -n, --rcs output RCS format (internally used by RCS)\n"
msgstr ""
-#: src/mdiff.c:3910
+#: src/mdiff.c:3909
msgid ""
"\n"
"Context and unified formats:\n"
@@ -252,7 +252,7 @@ msgid ""
"* -p, --show-c-function show which C function for each change\n"
msgstr ""
-#: src/mdiff.c:3917
+#: src/mdiff.c:3916
msgid ""
"\n"
"* -C, --context=LINES as -c, also select context size in lines\n"
@@ -265,7 +265,7 @@ msgid ""
"* -LINES (obsolete: select context size in lines)\n"
msgstr ""
-#: src/mdiff.c:3927
+#: src/mdiff.c:3926
msgid ""
"\n"
"Side by side format:\n"
@@ -276,7 +276,7 @@ msgid ""
"* --suppress-common-lines do not print common lines\n"
msgstr ""
-#: src/mdiff.c:3937
+#: src/mdiff.c:3936
#, c-format
msgid ""
"\n"
@@ -294,13 +294,13 @@ msgid ""
" %%L [line] with its possible trailing newline\n"
msgstr ""
-#: src/mdiff.c:3952
+#: src/mdiff.c:3951
msgid ""
"\n"
"SPECIF is [-][W[.D]]{doxX} as in C printf\n"
msgstr ""
-#: src/mdiff.c:3957
+#: src/mdiff.c:3956
msgid ""
"\n"
"VARIABLE is {eflmn} for old group or {EFLMN} for new group\n"
@@ -311,7 +311,7 @@ msgid ""
" {nN} number of lines in the group\n"
msgstr ""
-#: src/mdiff.c:3967
+#: src/mdiff.c:3966
msgid ""
"\n"
"Standard diff options:\n"
@@ -332,7 +332,7 @@ msgid ""
" -F, --show-function-line=RE show the most recent line matching RE\n"
msgstr ""
-#: src/mdiff.c:3986
+#: src/mdiff.c:3985
msgid ""
" -q, --brief output only whether files differ\n"
" -e, --ed output an ed script\n"
@@ -350,7 +350,7 @@ msgid ""
" -t, --expand-tabs expand tabs to spaces in output\n"
msgstr ""
-#: src/mdiff.c:4001
+#: src/mdiff.c:4000
msgid ""
" -T, --initial-tab make tabs line up by prepending a tab\n"
" -r, --recursive recursively compare any subdirectories found\n"
@@ -366,13 +366,13 @@ msgid ""
"changes\n"
msgstr ""
-#: src/mdiff.c:4016
+#: src/mdiff.c:4015
msgid ""
"\n"
"By default, context diffs have an horizon of two lines.\n"
msgstr ""
-#: src/mdiff.c:4022
+#: src/mdiff.c:4021
msgid ""
"\n"
"LTYPE is `old', `new', or `unchanged'. GTYPE is LTYPE or `changed'.\n"
@@ -389,7 +389,7 @@ msgid ""
" M L+1\n"
msgstr ""
-#: src/mdiff.c:4037
+#: src/mdiff.c:4036
msgid ""
"LFMT may contain:\n"
" %L contents of line\n"
@@ -401,52 +401,52 @@ msgid ""
" %c'\\OOO' the character with octal code OOO\n"
msgstr ""
-#: src/mdiff.c:4049
+#: src/mdiff.c:4048
msgid ""
"\n"
"Old mdiff options:\n"
"* -f, --fuzz-items=ITEMS no more than ITEMS non matching in a cluster\n"
msgstr ""
-#: src/mdiff.c:4055
+#: src/mdiff.c:4054
msgid ""
"\n"
"With no FILE, or when FILE is -, read standard input.\n"
msgstr ""
-#: src/mdiff.c:4059 src/unify.c:298 src/wdiff.c:1204 src/wdiff2.c:222
+#: src/mdiff.c:4058 src/unify.c:298 src/wdiff.c:1286 src/wdiff2.c:222
msgid ""
"\n"
"Report bugs to <address@hidden>.\n"
msgstr ""
-#: src/mdiff.c:4370
+#: src/mdiff.c:4369
msgid "Cannot use -z, termcap not available."
msgstr ""
-#: src/mdiff.c:4409
+#: src/mdiff.c:4408
msgid "Word merging for two files only (so far)"
msgstr ""
-#: src/mdiff.c:4425 src/wdiff2.c:129
+#: src/mdiff.c:4424 src/wdiff2.c:129
msgid ""
"\n"
"Copyright (C) 1997 Free Software Foundation, Inc.\n"
msgstr ""
-#: src/mdiff.c:4429 src/unify.c:410 src/wdiff.c:1328 src/wdiff2.c:133
+#: src/mdiff.c:4428 src/unify.c:410 src/wdiff.c:1415 src/wdiff2.c:133
msgid ""
"This is free software; see the source for copying conditions. There is NO\n"
"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
msgstr ""
-#: src/mdiff.c:4433 src/wdiff.c:1332 src/wdiff2.c:137
+#: src/mdiff.c:4432 src/wdiff.c:1419 src/wdiff2.c:137
msgid ""
"\n"
"Written by Franc,ois Pinard <address@hidden>.\n"
msgstr ""
-#: src/mdiff.c:4469
+#: src/mdiff.c:4468
msgid "Options -123RSYZ meaningful only when two inputs."
msgstr ""
@@ -530,11 +530,11 @@ msgstr ""
msgid "Context diff missing `new' header at line %ld"
msgstr ""
-#: src/wdiff.c:621 src/wdiff.c:652
+#: src/wdiff.c:614 src/wdiff.c:732
msgid "No suitable temporary directory exists"
msgstr ""
-#: src/wdiff.c:1145 src/wdiff2.c:108
+#: src/wdiff.c:1225 src/wdiff2.c:108
msgid ""
"This program is free software; you can redistribute it and/or modify\n"
"it under the terms of the GNU General Public License as published by\n"
@@ -551,18 +551,19 @@ msgid ""
"Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n"
msgstr ""
-#: src/wdiff.c:1174
+#: src/wdiff.c:1254
msgid "wdiff - Compares words in two files and report differences.\n"
msgstr ""
-#: src/wdiff.c:1177 src/wdiff2.c:185
+#: src/wdiff.c:1257
#, c-format
msgid ""
"\n"
"Usage: %s [OPTION]... FILE1 FILE2\n"
+" %s -d [OPTION]... [FILE]\n"
msgstr ""
-#: src/wdiff.c:1181 src/wdiff2.c:189
+#: src/wdiff.c:1262 src/wdiff2.c:189
#, c-format
msgid ""
"Mandatory arguments to long options are mandatory for short options too.\n"
@@ -574,10 +575,11 @@ msgid ""
" -3, --no-common inhibit output of common words\n"
msgstr ""
-#: src/wdiff.c:1189 src/wdiff2.c:198
+#: src/wdiff.c:1270
#, c-format
msgid ""
" -a, --auto-pager automatically calls a pager\n"
+" -d, --diff-input use single unified diff as input\n"
" -h, --help print this help\n"
" -i, --ignore-case fold character case while comparing\n"
" -l, --less-mode variation of printer mode for \"less\"\n"
@@ -585,7 +587,7 @@ msgid ""
" -p, --printer overstrike as for printers\n"
msgstr ""
-#: src/wdiff.c:1196 src/wdiff2.c:209
+#: src/wdiff.c:1278 src/wdiff2.c:209
#, c-format
msgid ""
" -s, --statistics say how many words deleted, inserted etc.\n"
@@ -597,17 +599,21 @@ msgid ""
" -z, --end-insert=STRING string to mark end of insert region\n"
msgstr ""
-#: src/wdiff.c:1319
+#: src/wdiff.c:1406
msgid "Cannot use -t, termcap not available."
msgstr ""
-#: src/wdiff.c:1324
+#: src/wdiff.c:1411
msgid ""
"\n"
"Copyright (C) 1992, 1997 Free Software Foundation, Inc.\n"
msgstr ""
-#: src/wdiff.c:1360 src/wdiff2.c:332
+#: src/wdiff.c:1458 src/wdiff.c:1475
+msgid "Too many file arguments"
+msgstr ""
+
+#: src/wdiff.c:1470 src/wdiff2.c:332
msgid "Missing file arguments"
msgstr ""
@@ -617,6 +623,23 @@ msgid ""
"This program exists mainly to support the now oldish `wdiff' syntax.\n"
msgstr ""
+#: src/wdiff2.c:185
+#, c-format
+msgid ""
+"\n"
+"Usage: %s [OPTION]... FILE1 FILE2\n"
+msgstr ""
+
+#: src/wdiff2.c:198
+msgid ""
+" -a, --auto-pager automatically calls a pager\n"
+" -h, --help print this help\n"
+" -i, --ignore-case fold character case while comparing\n"
+" -l, --less-mode variation of printer mode for \"less\"\n"
+" -n, --avoid-wraps do not extend fields through newlines\n"
+" -p, --printer overstrike as for printers\n"
+msgstr ""
+
#: src/wdiff2.c:206
msgid " -q, --quiet inhibit the `mdiff' call message\n"
msgstr ""
@@ -642,6 +665,6 @@ msgstr ""
msgid "Unknown system error"
msgstr ""
-#: lib/xalloc-die.c:35
+#: lib/xalloc-die.c:34
msgid "memory exhausted"
msgstr ""
- [wdiff-bugs] [PATCH] diff as input,
Martin von Gagern <=