Move base files from ~current~ to .patches/current/
[wiggle/upstream.git] / ReadMe.c
blobc2915bd4340204d22f0c78cb2840d551dcbc7d9c
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_options1[]="xdmwlrh123pVRvqB"; /* not mode B */
39 char short_options2[]="xdmwlrh123p:VRvqB"; /* mode B */
42 struct option long_options[] = {
43 {"browse", 0, 0, 'B'},
44 {"extract", 0, 0, 'x'},
45 {"diff", 0, 0, 'd'},
46 {"merge", 0, 0, 'm'},
47 {"words", 0, 0, 'w'},
48 {"lines", 0, 0, 'l'},
49 {"patch", 0, 0, 'p'},
50 {"replace", 0, 0, 'r'},
51 {"help", 0, 0, 'h'},
52 {"version", 0, 0, 'V'},
53 {"reverse", 0, 0, 'R'},
54 {"verbose", 0, 0, 'v'},
55 {"quiet", 0, 0, 'q'},
56 {"strip", 1, 0, 'p'},
57 {0, 0, 0, 0}
60 char Usage[] =
61 "Usage: wiggle --diff|--extract|--merge|--browse --lines|--words [--replace] files...\n";
63 char Help[] = "\n"
64 "Wiggle - apply patches that 'patch' rejects.\n"
65 "\n"
66 "Wiggle provides three distinct but related functions:\n"
67 "merge, diff, extract, and browse.\n"
68 "To get more detailed help on a function, select the function\n"
69 "before requesting help. e.g.\n"
70 " wiggle --diff --help\n"
71 "\n"
72 "Options:\n"
73 " --extract -x : select 'extract' function.\n"
74 " --diff -d : select 'diff' function.\n"
75 " --merge -m : select 'merge' function (default).\n"
76 " --browse -B : select 'browse' function.\n"
77 "\n"
78 " --words -w : word-wise diff and merge.\n"
79 " --lines -l : line-wise diff and merge.\n"
80 "\n"
81 " --patch -p : treat last file as a patch file.\n"
82 " -1 -2 -3 : select which component of patch or merge to use.\n"
83 " --reverse -R : swap 'before' and 'after' for diff function.\n"
84 "\n"
85 " --help -h : get help.\n"
86 " --version -V : get version of wiggle.\n"
87 " --verbose -v : (potentially) be more verbose.\n"
88 " --quiet -q : don't print un-necessary messages.\n"
89 "\n"
90 " --replace -r : replace first file with result of merger.\n"
91 "\n"
92 " --strip= -p : number of path components to strip from file names.\n"
93 "\n"
94 "Wiggle needs to be given 1, 2, or 3 files. Any one of these can\n"
95 "be given as '-' to signify standard input.\n"
96 "\n";
98 char HelpExtract[] = "\n"
99 "wiggle --extract -[123] [--patch] merge-or-patch\n"
100 "\n"
101 "The extract function allows one banch of a patch or merge file\n"
102 "to be extracted. A 'patch' is the output of 'diff -c' or 'diff -u'.\n"
103 "Either the before (-1) or after (-2) branch can be extracted.\n"
104 "\n"
105 "A 'merge' is the output of 'diff3 -m' or 'merge -A'. Either the\n"
106 "first, second, or third branch can be extracted.\n"
107 "\n"
108 "A 'merge' file is assumed unless --patch is given.\n"
109 "\n";
111 char HelpDiff[] = "\n"
112 "wiggle --diff [-wl] [-p12] [-R] file-or-patch [file-or-patch]\n"
113 "\n"
114 "The diff function will report the differencs and similarities between\n"
115 "two files in a format similar to 'diff -u'. With --word mode\n"
116 "(the default) word-wise differences are displayed on lines starting\n"
117 "with a '|'. With --line mode, only whole lines are considered\n"
118 "much like normal diff.\n"
119 "\n"
120 "If one file is given is it assumed to be a patch, and the two\n"
121 "branches of the patch are extracted and compared. If two files\n"
122 "are given they are normally assumed to be whole files and are compared.\n"
123 "However if the --patch option is given with two files, then the\n"
124 "second is treated as a patch and the first or (with -2) second branch\n"
125 "is extracted and compared against the first file.\n"
126 "\n"
127 "--reverse (-R) with cause diff two swap the two files before comparing\n"
128 "them.\n"
129 "\n";
131 char HelpMerge[] = "\n"
132 "wiggle --merge [-wl] [--replace] file-or-merge [file-or-patch [file]]\n"
133 "\n"
134 "The merge function is the primary function of wiggle and is assumed\n"
135 "if no function is explicitly chosen.\n"
136 "\n"
137 "Normally wiggle will compare three files on a word-by-word basis and\n"
138 "output unresolvable conflicts in the resulting merge by showing\n"
139 "whole-line differences.\n"
140 "With the --lines option, the files are compared line-wise much\n"
141 "like 'merge'. With the --words option, files are compared\n"
142 "word-wise and unresolvable conflicts are reported word-wise.\n"
143 "\n"
144 "If --merge is given one file, it is treated as a merge (merge -A\n"
145 "output) and the three needed streams are extracted from it.\n"
146 "If --merge is given two files, the second is treated as a patch\n"
147 "file and the first is the original file.\n"
148 "If --merge is given three files, they are each treated as whole files\n"
149 "and differences between the second and third are merged into the first.\n"
150 "This usage is much like 'merge'.\n"
151 "\n";
153 char HelpBrowse[] = "\n"
154 "wiggle --browse [-R] [--strip=n] multi-file-patch\n"
155 "\n"
156 "The 'browse' function provides an interactive mode for browsing a\n"
157 "set of patches. It allows the application of a patch to each file \n"
158 "to be inspected and allows limited editting to correct mis-application\n"
159 "of patches where wiggling was required, and where conflicts occurred.\n"
160 "\n";