1 /* merge - three-way file merge */
3 /* Copyright 1991, 1992, 1993, 1994, 1995 Paul Eggert
4 Distributed under license by the Free Software Foundation, Inc.
6 This file is part of RCS.
8 RCS is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 RCS is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with RCS; see the file COPYING.
20 If not, write to the Free Software Foundation,
21 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 Report problems and direct all questions to:
25 rcs-bugs@cs.purdue.edu
29 * $FreeBSD: src/gnu/usr.bin/rcs/merge/merge.c,v 1.5 1999/08/27 23:36:51 peter Exp $
30 * $DragonFly: src/gnu/usr.bin/rcs/merge/merge.c,v 1.2 2003/06/17 04:25:47 dillon Exp $
35 static void badoption P((char const*));
37 static char const usage[] =
38 "\nmerge: usage: merge [-AeEpqxX3] [-L lab [-L lab [-L lab]]] file1 file2 file3";
44 error("unknown option: %s%s", a, usage);
48 mainProg(mergeId, "merge", "$DragonFly: src/gnu/usr.bin/rcs/merge/merge.c,v 1.2 2003/06/17 04:25:47 dillon Exp $")
50 register char const *a;
51 char const *arg[3], *label[3], *edarg = 0;
57 for (; (a = *++argv) && *a++ == '-'; --argc) {
59 case 'A': case 'E': case 'e':
60 if (edarg && edarg[1] != (*argv)[1])
61 error("%s and %s are incompatible",
67 case 'p': tostdout = true; break;
68 case 'q': quietflag = true; break;
72 faterror("too many -L options");
73 if (!(label[labels++] = *++argv))
74 faterror("-L needs following argument");
79 printf("RCS version %s\n", RCS_version_string);
91 faterror("%s arguments%s",
92 argc<4 ? "not enough" : "too many", usage
95 /* This copy keeps us `const'-clean. */
100 for (; labels < 3; labels++)
101 label[labels] = arg[labels];
105 exitmain(merge(tostdout, edarg, label, arg));
110 # define exiterr mergeExit