NAME

insert-license - insert copyright & license into source files


SYNOPSIS

insert-license [options] [file | dir] [file | dir]


DESCRIPTION

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

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.

--all

By default autoconf input files, Makefiles and m4 source files are ignored. This switch indicates that all files should be considered.

--bak=suffix

The suffix appended to the filenames to generate a backup file. Do not preceed with a ..

--begin
--end

Where in the document to put the license. Leading '#!' lines are treated nicely.

--boundary|--noboundary

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.

--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.

--copyrightholder=name

The name of the copyright holder. Defaults to what's in the mstbuildsup templates.cfg file.

--delete

Remove licenses from files which have them. See also --insert, --update and --replace.

--dryrun|-n

Lots of hot air, but no results.

--exclude|-X glob

Exclude files or directories matching the glob. The glob is applied to the entire path, and, unlike a regular glob, extends across subdirectories.

--files glob

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

Insert licenses into files which don't have them. This is the default. See also --delete, --update and --replace.

--language=string

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.

--license=name

The (case sensitive) license type. The following are available: GPL, GPL2, GPL3, SAO. GPL is currently the same as GPL3. The default is GPL.

--package=name

The name of the package. If not specified, it is taken to be the name of the directory.

--partof|--nopartof

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

Replace the license in files which have existing licenses with that specified by --license. See also --insert, --update and --delete.

--template_dir

This specifies where the templates and the templates.cfg file are located. The default value should suffice.

--update

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.

--usage

Print a long usage message and exit.

--help

Print a short usage message and exit.

--status

Output a list of files and their status. The status flags are:

E

the file has an existing license

I

A license will be inserted.

U

The file has a license which would be updated if the --update option is specified.

?

unknown file type

--verbose

Be verbose.

--version

Print the version and exit.


COPYRIGHT & LICENSE

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


VERSION

This documents version @VERSION@ of insert-license.


AUTHOR

Diab Jerius <djerius@cfa.harvard.edu>