.\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
.    if \nF \{\
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{\
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "COPYRIGHT-UPDATE 1"
.TH COPYRIGHT-UPDATE 1 2025-04-04 "perl v5.40.1" "User commands"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
copyright\-update \- Update Copyright information in files
.SH USAGE
.IX Header "USAGE"
.Vb 2
\&  copyright\-update [options] FILE [FILE ...]
\&  copyright\-update [options] \-\-recursive PATH [PATH ...]
.Ve
.SH DESCRIPTION
.IX Header "DESCRIPTION"
Update the copyright information in a set of files, possibly
recursively, matching content criteria. The update affects the copyright
year, GPL address information, etc.
.PP
The line must contain the word "Copyright," a space, three characters '(C)'
(or a U+00A9 UTF copyright sign), a space, and the range of
years. A varying amount of spaces and tabs are permitted, but there must
be no spaces around the dash character in YEAR-YEAR. Examples:
.PP
.Vb 7
\&            A whitespace, or multiple, required
\&            |   |           No space between years
\&            |   |           |
\&   Copyright (C)        YYYY\-YYYY
\&   Copyright: (C)       YYYY\-YYYY
\&            |
\&            A colon is optional
.Ve
.PP
By default, certain files and paths are always ignored, such as version
control directories, backup files, object files, and binary files
according to Perl's \f(CW\*(C`\-T\*(C'\fR file test. Run the program with the option
\&\fB\-\-help\-exclude\fR to see the excluded path list.
.SH "REQUIRED ARGUMENTS"
.IX Header "REQUIRED ARGUMENTS"
Either FILE or PATH with \f(CW\*(C`\-\-recursive\*(C'\fR option.
.SH OPTIONS
.IX Header "OPTIONS"
.SS "Run options"
.IX Subsection "Run options"
.IP "\fB\-a, \-\-auto\fR" 4
.IX Item "-a, --auto"
In automatic mode, the author's name is read from the environment variable
NAME, and only lines matching 'Copyright.*$NAME' are affected. If NAME
is not set, the information is read from EMAIL.
.Sp
If neither NAME nor EMAIL exists in the environment, or if their values
are not in a recognizable format (see section ENVIRONMENT), this
option does nothing.
.Sp
This option effectively tries to preset a value for the \fB\-\-line\fR option.
.IP "\fB\-c, \-\-code\fR" 4
.IX Item "-c, --code"
Preset \fB\-\-include\fR to match common code files: .c, .h, .cc, .hh, .cpp,
\&.c++, .hpp, .C, .pl, .py, .sh, and .rb.
.IP "\fB\-D, \-\-debug LEVEL\fR" 4
.IX Item "-D, --debug LEVEL"
Turn on debugging. LEVEL can be in the range of 0\-10.
.IP "\fB\-f, \-\-fsf\-address\fR" 4
.IX Item "-f, --fsf-address"
Change license paragraphs that refer to the FSF address. The FSF's current
recommendation is to redirect inquiries about licenses to their URL.
.Sp
Effectively replace the paragraphs:
.Sp
.Vb 3
\&  You should have received a copy of the GNU General Public License
\&  along with this program; if not, write to the Free Software
\&  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111\-1307 USA
\&
\&  You should have received a copy of the GNU General Public License
\&  along with this package; if not, write to the Free Software
\&  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110\-1301 USA
.Ve
.Sp
With this:
.Sp
.Vb 2
\&  You should have received a copy of the GNU General Public License
\&  along with this program. If not, see <http://www.gnu.org/licenses/>.
.Ve
.IP "\fB\-i, \-\-include REGEXP\fR" 4
.IX Item "-i, --include REGEXP"
Include files matching regexp. The match is done against whole path.
.Sp
If this option is not supplied, every file is automatically included.
The matches can be further filtered by using option \fB\-\-exclude\fR.
.Sp
This option can be used multiple times. See also option \fB\-\-code\fR.
.IP "\fB\-l, \-\-line REGEXP\fR" 4
.IX Item "-l, --line REGEXP"
Change only lines which match REGEXP. The match is case-insensitive.
.IP "\fB\-r, \-\-recursive\fR" 4
.IX Item "-r, --recursive"
Recursively search all directories given in command line.
.IP "\fB\-R, \-\-regexp REGEXP\fR" 4
.IX Item "-R, --regexp REGEXP"
Change only files whose content matches REGEXP. The file is read
in as a one big string so that it's possible to match using Perl
regular expressions across the whole file. An example:
\&\f(CW\*(Aq(?smi)This.*multi.*line.*match\*(Aq\fR. See \f(CWperlre(1)\fR for more
information about \f(CW\*(Aqsmi\*(Aq\fR and other modifiers.
.Sp
This option can be used as a preliminary \fIContent criteria\fR, to
select files before \fB\-\-line\fR option finds the correct Copyright
lines.
.IP "\fB\-t, \-\-test, \-\-dry\-run\fR" 4
.IX Item "-t, --test, --dry-run"
Run in test mode. Show what would happen. No files are changed.
.IP "\fB\-v, \-\-verbose LEVEL\fR" 4
.IX Item "-v, --verbose LEVEL"
Print informational messages. Increase numeric LEVEL for more
verbosity.
.IP "\fB\-x, \-\-exclude REGEXP\fR" 4
.IX Item "-x, --exclude REGEXP"
Ignore files matching regexp. The match is done against whole path.
The option can be used multiple times.
.Sp
This option is applied after possible \fB\-\-include\fR matches.
.IP "\fB\-y, \-\-year YEAR\fR" 4
.IX Item "-y, --year YEAR"
Update files using YEAR. Value must be four digits.
.Sp
The default operation is to use currect year, so this option is not
necessary in normal use. Use case: you plan to take a long holiday
before year's end and want to update the next year's value beforehand.
.IP "\fB\-Y, \-\-no\-year\fR" 4
.IX Item "-Y, --no-year"
Disable updating year.
.SS "Miscellaneus options"
.IX Subsection "Miscellaneus options"
.IP "\fB\-h, \-\-help\fR" 4
.IX Item "-h, --help"
Display help.
.IP \fB\-\-help\-exclude\fR 4
.IX Item "--help-exclude"
Display default values used to exclude paths and files.
.IP \fB\-\-help\-html\fR 4
.IX Item "--help-html"
Display help in HTML format.
.IP \fB\-\-help\-man\fR 4
.IX Item "--help-man"
Display help in manual page \f(CWman(1)\fR format.
.IP "\fB\-V, \-\-version\fR" 4
.IX Item "-V, --version"
Display contact and version information.
.SH EXAMPLES
.IX Header "EXAMPLES"
The primary use is to update files to reflect current year; option
\&\fB\-\-year\fR is implicit:
.PP
.Vb 1
\&   copyright\-update *
.Ve
.PP
To test what would happen:
.PP
.Vb 1
\&   copyright\-update \-\-verbose 1 \-\-test *
.Ve
.PP
Update only C\-code file:
.PP
.Vb 1
\&   copyright\-update \-\-verbose 1 \-\-include \*(Aq\e.[ch]$\*(Aq \-\-recursive .
.Ve
.PP
It is possible to restrict updating files recursively to only those
files whose content match regexp. Here, the lines affected are those
that match \fB\-\-line\fR regular expression.
.PP
.Vb 9
\&   copyright\-update \e
\&        \-\-regexp  \*(Aq(?i)Author:.*John.*Doe\*(Aq \e
\&        \-\-line    \*(Aq\ebFoo\eb\*(Aq \e
\&        \-\-ignore  \*(Aq\e.(bak|bup|[~#]])$\*(Aq \e
\&        \-\-verbose 1 \e
\&        \-\-year    2013 \e
\&        \-\-test \e
\&        \-\-recursive \e
\&        .
.Ve
.SH TROUBLESHOOTING
.IX Header "TROUBLESHOOTING"
See option \fB\-\-debug\fR.
.SH ENVIRONMENT
.IX Header "ENVIRONMENT"
.IP EMAIL 4
.IX Item "EMAIL"
In the form "firstname.lastname@example.com"; that is, without the
angles <>. If set, the value is used in option \fB\-\-auto\fR only if
environment variable NAME is not set.
.Sp
In order to find first and lastname, the localpart in email address
must match case insensitive regexp \f(CW\*(Aq^[a\-z\-]+\e.[a\-z\-]+@\*(Aq\fR:
.Sp
.Vb 2
\&    address@example.com            Not used, not in form First.Last
\&    +\-\-\-\-\-\- +\-\-\-\-\-\-\-\-\-\-
\&
\&    mr.first.lastname@example.com  Not used, likewise
\&    +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- +\-\-\-\-\-\-\-\-\-\-
\&    |                 |
\&    Localpart         Domain part
.Ve
.IP NAME 4
.IX Item "NAME"
In the form "Firstname Lastname". If set, the value is used in option
\&\fB\-\-auto\fR.
.SH DIAGNOSTICS
.IX Header "DIAGNOSTICS"
See option \f(CW\*(C`\-\-debug LEVEL\*(C'\fR
.SH "EXIT STATUS"
.IX Header "EXIT STATUS"
Value 0 on normal exit and non-zero on error.
.SH CONFIGURATION
.IX Header "CONFIGURATION"
None.
.SH DEPENDENCIES
.IX Header "DEPENDENCIES"
None. Uses only standard Perl modules.
.SH INCOMPATIBILITIES
.IX Header "INCOMPATIBILITIES"
None.
.SH FILES
.IX Header "FILES"
None.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBlicensecheck\fR\|(1)
.SH "BUGS AND LIMITATIONS"
.IX Header "BUGS AND LIMITATIONS"
The Copyright stanzas searched with option \fB\-\-fsf\-address\fR must be
exactly like in the FSF recommendation in order for them to be
noticed. See STANDARDS.
.SH STANDARDS
.IX Header "STANDARDS"
\&\f(CW\*(C`How to use GNU licenses for your own software\*(C'\fR
http://www.gnu.org/copyleft/gpl\-howto.html
.PP
\&\f(CW\*(C`Information for maintainers of GNU software (6.5 Copyright Notices)\*(C'\fR
http://www.gnu.org/prep/maintain/html_node/Copyright\-Notices.html
.PP
\&\f(CW\*(C`Information for maintainers of GNU software (6.6 License Notices)\*(C'\fR
http://www.gnu.org/prep/maintain/html_node/License\-Notices.html#License\-Notices
.SH AVAILABILITY
.IX Header "AVAILABILITY"
Homepage is at https://github.com/jaalto/project\-\-copyright\-update
.SH AUTHOR
.IX Header "AUTHOR"
Jari Aalto
.SH "LICENSE AND COPYRIGHT"
.IX Header "LICENSE AND COPYRIGHT"
Copyright (C) 2000\-2025 Jari Aalto
.PP
This program is free software; you can redistribute and/or modify
program under the terms of GNU General Public license either version 2
of the License, or (at your option) any later version.
For more information, see see <http://www.gnu.org/licenses/>.
