Still more updates to 'p'
[wiggle.git] / ReadMe.c
blob6da1ab5fec78f52c430b73d11897f9c913fe79e6
1 /*
2 * wiggle - apply rejected patches
4 * Copyright (C) 2003 Neil Brown <neilb@cse.unsw.edu.au>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 * Author: Neil Brown
22 * Email: <neilb@cse.unsw.edu.au>
23 * Paper: Neil Brown
24 * School of Computer Science and Engineering
25 * The University of New South Wales
26 * Sydney, 2052
27 * Australia
31 * Options and help text for wiggle
34 #include "wiggle.h"
36 char Version[] = "wiggle - v0.6 - 20 May 2003\n";
38 char short_options[]="xdmwlrh123pVRvq";
39 struct option long_options[] = {
40 {"extract", 0, 0, 'x'},
41 {"diff", 0, 0, 'd'},
42 {"merge", 0, 0, 'm'},
43 {"words", 0, 0, 'w'},
44 {"lines", 0, 0, 'l'},
45 {"patch", 0, 0, 'p'},
46 {"replace", 0, 0, 'r'},
47 {"help", 0, 0, 'h'},
48 {"version", 0, 0, 'V'},
49 {"reverse", 0, 0, 'R'},
50 {"verbose", 0, 0, 'v'},
51 {"quiet", 0, 0, 'q'},
52 {0, 0, 0, 0}
55 char Usage[] =
56 "Usage: wiggle --diff|--extract|--merge --lines|--words [--replace] files...\n";
58 char Help[] = "\n"
59 "Wiggle - apply patches that 'patch' rejects.\n"
60 "\n"
61 "Wiggle provides three distinct but related functions:\n"
62 "merge, diff, and extract.\n"
63 "To get more detailed help on a function, select the function\n"
64 "before requesting help. e.g.\n"
65 " wiggle --diff --help\n"
66 "\n"
67 "Options:\n"
68 " --extract -x : select 'extract' function.\n"
69 " --diff -d : select 'diff' function.\n"
70 " --merge -m : select 'merge' function (default).\n"
71 "\n"
72 " --words -w : word-wise diff and merge.\n"
73 " --lines -l : line-wise diff and merge.\n"
74 "\n"
75 " --patch -p : treat last file as a patch file.\n"
76 " -1 -2 -3 : select which component of patch or merge to use.\n"
77 " --reverse -R : swap 'before' and 'after' for diff function.\n"
78 "\n"
79 " --help -h : get help.\n"
80 " --version -V : get version of wiggle.\n"
81 " --verbose -v : (potentially) be more verbose.\n"
82 " --quiet -q : don't print un-necessary messages.\n"
83 "\n"
84 " --replace -r : replace first file with result of merger.\n"
85 "\n"
86 "Wiggle needs to be given 1, 2, or 3 files. Any one of these can\n"
87 "be given as '-' to signify standard input.\n"
88 "\n";
90 char HelpExtract[] = "\n"
91 "wiggle --extract -[123] [--patch] merge-or-patch\n"
92 "\n"
93 "The extract function allows one banch of a patch or merge file\n"
94 "to be extracted. A 'patch' is the output of 'diff -c' or 'diff -u'.\n"
95 "Either the before (-1) or after (-2) branch can be extracted.\n"
96 "\n"
97 "A 'merge' is the output of 'diff3 -m' or 'merge -A'. Either the\n"
98 "first, second, or third branch can be extracted.\n"
99 "\n"
100 "A 'merge' file is assumed unless --patch is given.\n"
101 "\n";
103 char HelpDiff[] = "\n"
104 "wiggle --diff [-wl] [-p12] [-R] file-or-patch [file-or-patch]\n"
105 "\n"
106 "The diff function will report the differencs and similarities between\n"
107 "two files in a format similar to 'diff -u'. With --word mode\n"
108 "(the default) word-wise differences are displayed on lines starting\n"
109 "with a '|'. With --line mode, only whole lines are considered\n"
110 "much like normal diff.\n"
111 "\n"
112 "If one file is given is it assumed to be a patch, and the two\n"
113 "branches of the patch are extracted and compared. If two files\n"
114 "are given they are normally assumed to be whole files and are compared.\n"
115 "However if the --patch option is given with two files, then the\n"
116 "second is treated as a patch and the first or (with -2) second branch\n"
117 "is extracted and compared against the first file.\n"
118 "\n"
119 "--reverse (-R) with cause diff two swap the two files before comparing\n"
120 "them.\n"
121 "\n";
123 char HelpMerge[] = "\n"
124 "wiggle --merge [-wl] [--replace] file-or-merge [file-or-patch [file]]\n"
125 "\n"
126 "The merge function is the primary function of wiggle and is assumed\n"
127 "if no function is explicitly chosen.\n"
128 "\n"
129 "Normally wiggle will compare three files on a word-by-word basis and\n"
130 "output unresolvable conflicts in the resulting merge by showing\n"
131 "whole-line differences.\n"
132 "With the --lines option, the files are compared line-wise much\n"
133 "like 'merge'. With the --words option, files are compared\n"
134 "word-wise and unresolvable conflicts are reported word-wise.\n"
135 "\n"
136 "If --merge is given one file, it is treated as a merge (merge -A\n"
137 "output) and the three needed streams are extracted from it.\n"
138 "If --merge is given two files, the second is treated as a patch\n"
139 "file and the first is the original file.\n"
140 "If --merge is given three files, they are each treated as whole files\n"
141 "and differences between the second and third are merged into the first.\n"
142 "This usage is much like 'merge'.\n"
143 "\n";