NAME

licensecheck - simple license checker for source files

VERSION

Version v3.0.1

SYNOPSIS

licensecheck --help|--version

licensecheck [options...] path [path...]

DESCRIPTION

licensecheck attempts to determine the license that applies to each file passed to it, by searching the start of the file for text belonging to various licenses.

If any of the arguments passed are directories, licensecheck will add the files contained within to the list of files to process.

OPTIONS

-c, --check regex

Regular expression of files to include.

The default includes common source files.

-i, --ignore regex

Regular expression of files to skip.

Default covers some backup files and VCS metadata.

-r, --recursive

Traverse directories recursively.

-l, --lines N

Number of lines to parse from top of each file.

Set to 0 to parse the whole file (and ignore --tail option). Generally faster except for huge files.

Default is 60 lines.

--tail N

Number of bytes to parse from bottom of each file.

Set to 0 to avoid parsing from end of file.

Default is 5000 bytes (roughly 60 lines)

-e, --encoding

Try decode source files as specified codec or latin1.

By default, input files are not decoded.

--verbose

Add header of each file to license information.

Add copyright statements to license information.

-s, --skipped

Print skipped files to STDERR, i.e. files matching --check option but not --ignore option.

--deb-fmt

Use Debian license shortnames (based on SPDX keywords).

-m, --machine

Print license information as TAB-separated fields, for processing with line-oriented tools like awk and sort.

NB! The --verbose option will kill the readability.

--deb-machine

Print license information like a Debian copyright file.

--list-delimiter

Printf-string used between multiple plain list items in Debian copyright file.

Default is '\n ' (NEWLINE SPACE SPACE).

--rfc822-delimiter

Printf-string used between multiple RFC822-style items in Debian copyright file.

Default is '\n ' (NEWLINE SPACE SPACE SPACE).

--merge-licenses

Merge same-licensed files in Debian copyright file.

-h, --help

Print help message and exit successfully.

-v, --version

Print version and copyright information and exit successfully.

AUTHOR

Jonas Smedegaard <dr@jones.dk>

COPYRIGHT AND LICENSE

This program is based on the script "licensecheck" from the KDE SDK, originally introduced by Stefan Westerfeld <stefan@space.twc.de>.

Copyright © 2007, 2008 Adam D. Barratt

Copyright © 2012 Francesco Poli

Copyright © 2016 Jonas Smedegaard

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.