Debian Codegraph @

bin/copyright-update.1

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "COPYRIGHT-UPDATE 1"
58 .TH COPYRIGHT-UPDATE 1 2025-04-04 "perl v5.40.1" "User commands"
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 copyright\-update \- Update Copyright information in files
65 .SH USAGE
66 .IX Header "USAGE"
67 .Vb 2
68 \& copyright\-update [options] FILE [FILE ...]
69 \& copyright\-update [options] \-\-recursive PATH [PATH ...]
70 .Ve
71 .SH DESCRIPTION
72 .IX Header "DESCRIPTION"
73 Update the copyright information in a set of files, possibly
74 recursively, matching content criteria. The update affects the copyright
75 year, GPL address information, etc.
76 .PP
77 The line must contain the word "Copyright," a space, three characters '(C)'
78 (or a U+00A9 UTF copyright sign), a space, and the range of
79 years. A varying amount of spaces and tabs are permitted, but there must
80 be no spaces around the dash character in YEAR-YEAR. Examples:
81 .PP
82 .Vb 7
83 \& A whitespace, or multiple, required
84 \& | | No space between years
85 \& | | |
86 \& Copyright (C) YYYY\-YYYY
87 \& Copyright: (C) YYYY\-YYYY
88 \& |
89 \& A colon is optional
90 .Ve
91 .PP
92 By default, certain files and paths are always ignored, such as version
93 control directories, backup files, object files, and binary files
94 according to Perl's \f(CW\*(C`\-T\*(C'\fR file test. Run the program with the option
95 \&\fB\-\-help\-exclude\fR to see the excluded path list.
96 .SH "REQUIRED ARGUMENTS"
97 .IX Header "REQUIRED ARGUMENTS"
98 Either FILE or PATH with \f(CW\*(C`\-\-recursive\*(C'\fR option.
99 .SH OPTIONS
100 .IX Header "OPTIONS"
101 .SS "Run options"
102 .IX Subsection "Run options"
103 .IP "\fB\-a, \-\-auto\fR" 4
104 .IX Item "-a, --auto"
105 In automatic mode, the author's name is read from the environment variable
106 NAME, and only lines matching 'Copyright.*$NAME' are affected. If NAME
107 is not set, the information is read from EMAIL.
108 .Sp
109 If neither NAME nor EMAIL exists in the environment, or if their values
110 are not in a recognizable format (see section ENVIRONMENT), this
111 option does nothing.
112 .Sp
113 This option effectively tries to preset a value for the \fB\-\-line\fR option.
114 .IP "\fB\-c, \-\-code\fR" 4
115 .IX Item "-c, --code"
116 Preset \fB\-\-include\fR to match common code files: .c, .h, .cc, .hh, .cpp,
117 \&.c++, .hpp, .C, .pl, .py, .sh, and .rb.
118 .IP "\fB\-D, \-\-debug LEVEL\fR" 4
119 .IX Item "-D, --debug LEVEL"
120 Turn on debugging. LEVEL can be in the range of 0\-10.
121 .IP "\fB\-f, \-\-fsf\-address\fR" 4
122 .IX Item "-f, --fsf-address"
123 Change license paragraphs that refer to the FSF address. The FSF's current
124 recommendation is to redirect inquiries about licenses to their URL.
125 .Sp
126 Effectively replace the paragraphs:
127 .Sp
128 .Vb 3
129 \& You should have received a copy of the GNU General Public License
130 \& along with this program; if not, write to the Free Software
131 \& Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111\-1307 USA
132 \&
133 \& You should have received a copy of the GNU General Public License
134 \& along with this package; if not, write to the Free Software
135 \& Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110\-1301 USA
136 .Ve
137 .Sp
138 With this:
139 .Sp
140 .Vb 2
141 \& You should have received a copy of the GNU General Public License
142 \& along with this program. If not, see <http://www.gnu.org/licenses/>.
143 .Ve
144 .IP "\fB\-i, \-\-include REGEXP\fR" 4
145 .IX Item "-i, --include REGEXP"
146 Include files matching regexp. The match is done against whole path.
147 .Sp
148 If this option is not supplied, every file is automatically included.
149 The matches can be further filtered by using option \fB\-\-exclude\fR.
150 .Sp
151 This option can be used multiple times. See also option \fB\-\-code\fR.
152 .IP "\fB\-l, \-\-line REGEXP\fR" 4
153 .IX Item "-l, --line REGEXP"
154 Change only lines which match REGEXP. The match is case-insensitive.
155 .IP "\fB\-r, \-\-recursive\fR" 4
156 .IX Item "-r, --recursive"
157 Recursively search all directories given in command line.
158 .IP "\fB\-R, \-\-regexp REGEXP\fR" 4
159 .IX Item "-R, --regexp REGEXP"
160 Change only files whose content matches REGEXP. The file is read
161 in as a one big string so that it's possible to match using Perl
162 regular expressions across the whole file. An example:
163 \&\f(CW\*(Aq(?smi)This.*multi.*line.*match\*(Aq\fR. See \f(CWperlre(1)\fR for more
164 information about \f(CW\*(Aqsmi\*(Aq\fR and other modifiers.
165 .Sp
166 This option can be used as a preliminary \fIContent criteria\fR, to
167 select files before \fB\-\-line\fR option finds the correct Copyright
168 lines.
169 .IP "\fB\-t, \-\-test, \-\-dry\-run\fR" 4
170 .IX Item "-t, --test, --dry-run"
171 Run in test mode. Show what would happen. No files are changed.
172 .IP "\fB\-v, \-\-verbose LEVEL\fR" 4
173 .IX Item "-v, --verbose LEVEL"
174 Print informational messages. Increase numeric LEVEL for more
175 verbosity.
176 .IP "\fB\-x, \-\-exclude REGEXP\fR" 4
177 .IX Item "-x, --exclude REGEXP"
178 Ignore files matching regexp. The match is done against whole path.
179 The option can be used multiple times.
180 .Sp
181 This option is applied after possible \fB\-\-include\fR matches.
182 .IP "\fB\-y, \-\-year YEAR\fR" 4
183 .IX Item "-y, --year YEAR"
184 Update files using YEAR. Value must be four digits.
185 .Sp
186 The default operation is to use currect year, so this option is not
187 necessary in normal use. Use case: you plan to take a long holiday
188 before year's end and want to update the next year's value beforehand.
189 .IP "\fB\-Y, \-\-no\-year\fR" 4
190 .IX Item "-Y, --no-year"
191 Disable updating year.
192 .SS "Miscellaneus options"
193 .IX Subsection "Miscellaneus options"
194 .IP "\fB\-h, \-\-help\fR" 4
195 .IX Item "-h, --help"
196 Display help.
197 .IP \fB\-\-help\-exclude\fR 4
198 .IX Item "--help-exclude"
199 Display default values used to exclude paths and files.
200 .IP \fB\-\-help\-html\fR 4
201 .IX Item "--help-html"
202 Display help in HTML format.
203 .IP \fB\-\-help\-man\fR 4
204 .IX Item "--help-man"
205 Display help in manual page \f(CWman(1)\fR format.
206 .IP "\fB\-V, \-\-version\fR" 4
207 .IX Item "-V, --version"
208 Display contact and version information.
209 .SH EXAMPLES
210 .IX Header "EXAMPLES"
211 The primary use is to update files to reflect current year; option
212 \&\fB\-\-year\fR is implicit:
213 .PP
214 .Vb 1
215 \& copyright\-update *
216 .Ve
217 .PP
218 To test what would happen:
219 .PP
220 .Vb 1
221 \& copyright\-update \-\-verbose 1 \-\-test *
222 .Ve
223 .PP
224 Update only C\-code file:
225 .PP
226 .Vb 1
227 \& copyright\-update \-\-verbose 1 \-\-include \*(Aq\e.[ch]$\*(Aq \-\-recursive .
228 .Ve
229 .PP
230 It is possible to restrict updating files recursively to only those
231 files whose content match regexp. Here, the lines affected are those
232 that match \fB\-\-line\fR regular expression.
233 .PP
234 .Vb 9
235 \& copyright\-update \e
236 \& \-\-regexp \*(Aq(?i)Author:.*John.*Doe\*(Aq \e
237 \& \-\-line \*(Aq\ebFoo\eb\*(Aq \e
238 \& \-\-ignore \*(Aq\e.(bak|bup|[~#]])$\*(Aq \e
239 \& \-\-verbose 1 \e
240 \& \-\-year 2013 \e
241 \& \-\-test \e
242 \& \-\-recursive \e
243 \& .
244 .Ve
245 .SH TROUBLESHOOTING
246 .IX Header "TROUBLESHOOTING"
247 See option \fB\-\-debug\fR.
248 .SH ENVIRONMENT
249 .IX Header "ENVIRONMENT"
250 .IP EMAIL 4
251 .IX Item "EMAIL"
252 In the form "[email protected]"; that is, without the
253 angles <>. If set, the value is used in option \fB\-\-auto\fR only if
254 environment variable NAME is not set.
255 .Sp
256 In order to find first and lastname, the localpart in email address
257 must match case insensitive regexp \f(CW\*(Aq^[a\-z\-]+\e.[a\-z\-]+@\*(Aq\fR:
258 .Sp
259 .Vb 2
260 \& [email protected] Not used, not in form First.Last
261 \& +\-\-\-\-\-\- +\-\-\-\-\-\-\-\-\-\-
262 \&
263 \& [email protected] Not used, likewise
264 \& +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- +\-\-\-\-\-\-\-\-\-\-
265 \& | |
266 \& Localpart Domain part
267 .Ve
268 .IP NAME 4
269 .IX Item "NAME"
270 In the form "Firstname Lastname". If set, the value is used in option
271 \&\fB\-\-auto\fR.
272 .SH DIAGNOSTICS
273 .IX Header "DIAGNOSTICS"
274 See option \f(CW\*(C`\-\-debug LEVEL\*(C'\fR
275 .SH "EXIT STATUS"
276 .IX Header "EXIT STATUS"
277 Value 0 on normal exit and non-zero on error.
278 .SH CONFIGURATION
279 .IX Header "CONFIGURATION"
280 None.
281 .SH DEPENDENCIES
282 .IX Header "DEPENDENCIES"
283 None. Uses only standard Perl modules.
284 .SH INCOMPATIBILITIES
285 .IX Header "INCOMPATIBILITIES"
286 None.
287 .SH FILES
288 .IX Header "FILES"
289 None.
290 .SH "SEE ALSO"
291 .IX Header "SEE ALSO"
292 \&\fBlicensecheck\fR\|(1)
293 .SH "BUGS AND LIMITATIONS"
294 .IX Header "BUGS AND LIMITATIONS"
295 The Copyright stanzas searched with option \fB\-\-fsf\-address\fR must be
296 exactly like in the FSF recommendation in order for them to be
297 noticed. See STANDARDS.
298 .SH STANDARDS
299 .IX Header "STANDARDS"
300 \&\f(CW\*(C`How to use GNU licenses for your own software\*(C'\fR
301 http://www.gnu.org/copyleft/gpl\-howto.html
302 .PP
303 \&\f(CW\*(C`Information for maintainers of GNU software (6.5 Copyright Notices)\*(C'\fR
304 http://www.gnu.org/prep/maintain/html_node/Copyright\-Notices.html
305 .PP
306 \&\f(CW\*(C`Information for maintainers of GNU software (6.6 License Notices)\*(C'\fR
307 http://www.gnu.org/prep/maintain/html_node/License\-Notices.html#License\-Notices
308 .SH AVAILABILITY
309 .IX Header "AVAILABILITY"
310 Homepage is at https://github.com/jaalto/project\-\-copyright\-update
311 .SH AUTHOR
312 .IX Header "AUTHOR"
313 Jari Aalto
314 .SH "LICENSE AND COPYRIGHT"
315 .IX Header "LICENSE AND COPYRIGHT"
316 Copyright (C) 2000\-2025 Jari Aalto
317 .PP
318 This program is free software; you can redistribute and/or modify
319 program under the terms of GNU General Public license either version 2
320 of the License, or (at your option) any later version.
321 For more information, see see <http://www.gnu.org/licenses/>.