insert-license - insert copyright & license into source files
insert-license [options] [file | dir] [file | dir]
This program inserts, deletes, or replaces a copyright and license statement at the beginning or end of files. It attempts to recognize the type of file (programming language, for example) and use the correct comment syntax. It recognizes leading '#!' lines and acts accordingly.
Licenses are taken from an installed mstbuildsup distribution. It is expected to be in the ``standard'' place.
Options are specified using a getopt style interface. Long names are
available when preceded with double hyphens --
, in which case only
the minimal number of characters are required. Options which take
values are separated from those values with the =
character.
By default autoconf input files, Makefiles and m4 source files are ignored. This switch indicates that all files should be considered.
The suffix appended to the filenames to generate a backup file.
Do not preceed with a .
.
Where in the document to put the license. Leading '#!' lines are treated nicely.
If true (the default) the license is preceded and followed by comments which allow the chunk of text to be later recognized (e.g. to remove or change it). See --boundary_start, --boundary_end, --boundary_both.
These optionally specify the boundary strings. Use --boundary_both for a common string, the others to specify different ones for the start and end boundaries.
The name of the copyright holder. Defaults to what's in the mstbuildsup templates.cfg file.
Remove licenses from files which have them. See also --insert, --update and --replace.
Lots of hot air, but no results.
Exclude files or directories matching the glob. The glob is applied to the entire path, and, unlike a regular glob, extends across subdirectories.
This option (which may be used multiple times) specifies a shell filename pattern identifying files to process. The pattern is applied to the basename of the files. For example:
--files '*.pm'
If no directories or files are specified on the command line, this option will force a scan of the current directory and subdirectories.
Insert licenses into files which don't have them. This is the default. See also --delete, --update and --replace.
The language the program is written in. The available ones are:
none
,
autoconf
,
automake
,
c
,
cxx
,
fortran
,
lua
,
perl
,
shell
,
and
tex
.
If not specified insert-license will attempt to guess based upon the filename suffix or the file content. It will die if it cannot determine the file type.
The (case sensitive) license type. The following are available:
GPL
, GPL2
, GPL3
, SAO
. GPL
is currently the same as GPL3
.
The default is GPL
.
The name of the package. If not specified, it is taken to be the name of the directory.
By default, a line indicating that the file is part of the package is placed after the copyright line. This option turns that off.
Replace the license in files which have existing licenses with that specified by --license. See also --insert, --update and --delete.
This specifies where the templates and the templates.cfg file are located. The default value should suffice.
If a file contains a license which is not the same as that specified by --license it will be replaced. insert-license attempts to ignore changes in copyright dates. See also --insert, --replace and --delete.
Print a long usage message and exit.
Print a short usage message and exit.
Output a list of files and their status. The status flags are:
the file has an existing license
A license will be inserted.
The file has a license which would be updated if the --update option is specified.
unknown file type
Be verbose.
Print the version and exit.
Copyright 2007 Smithsonian Astrophysical Observatory
This software is released under the GNU General Public License. You may find a copy at
http://www.gnu.org/licenses
This documents version @VERSION@ of insert-license.
Diab Jerius <djerius@cfa.harvard.edu>