insert-license - insert copyright & license into source files
insert-license [options] [file | dir] [file | dir]
This program inserts 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.
- --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.
- --check|--nocheck
-
If the file already has a license (if it contains a boundary start
string), don't bother inserting a new one. The default is to make the
check.
- --copyrightholder=name
-
The name of the copyright holder. Defaults to what's in the
mstbuildsup templates.cfg file.
- --dryrun|-n
-
Lots of hot air, but no results. See --verbose for a description
of the output generated.
- --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.
- --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
, SAO
.
- --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.
- --template_dir
-
This specifies where the templates and the templates.cfg file are located.
The default value should suffice.
- --usage
-
Print a long usage message and exit.
- --help
-
Print a short usage message and exit.
- --verbose
-
Output a list of files and their status. The status flags are:
- E
-
the file has an existing license (see --check)
- I
-
a license will be inserted
- U
-
unknown file type
- --version
-
Print the version and exit.
Copyright 2006 Smithsonian Astrophysical Observatory
This software is released under the GNU General Public License. You may find
a copy at
http://www.fsf.org/copyleft/gpl.html
This documents version @VERSION@ of insert-license.
Diab Jerius <djerius@cfa.harvard.edu>