licensecheck(1p)

licensecheck1p

Simple license checker for source files

Usage

licensecheck [{--help | --version}]

licensecheck [{--list-licenses | --list-naming-schemes}]

licensecheck [OPTION ...] PATH [PATH ...]

Version

Version v3.3.9

Overview

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.

When multiple PATHs are provided, only files matching --check and not --ignore are checked.

Options

Resolving patterns

--shortname-scheme

Since v3.2.

comma-separated priority list of license naming schemes to use for license identifiers (default value: unset (use verbose description))

--list-licenses

Since v3.2.

list identifiers for all detectable licenses and exit

--list-naming-schemes

Since v3.2.

list all available license naming schemes and exit

Selecting files

-c REGEX, --check=REGEX

Since v2.10.10.

regular expression of files to include when more than one PATH is provided (default value: common source files)

-i REGEX, --ignore=REGEX

Since v2.10.10.

regular expression of files to skip when more than one PATH is provided (default value: some backup and VCS files)

-r, --recursive

Since v2.10.7.

traverse directories recursively

Parsing contents

-l N, --lines=N

Since v2.10.3.

number of lines to parse from top of each file; implies optimistic search including only first cluster of detected copyrights or licenses; set to 0 to parse the whole file (and ignore --tail) (default value: 60)

--tail=N

Since v2.15.10.

number of bytes to parse from bottom of each file when parsing only from top of each file and finding nothing there; set to 0 to avoid parsing from end of file (or set --lines to 0 and ignore this setting) (default value: 5000 (roughly 60 lines))

-e CODEC, --encoding=CODEC

Since v2.15.10.

try decode source files from the specified codec, with "iso-8859-1" as fallback (default value: unset (no decoding))

Reporting results

-s, --skipped

Since v3.3.0.

Log files in PATHs matching neither --check nor --ignore as warnings (default: log as debug)

-m, --machine

Since v2.12.2.

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

--[no-]deb-machine

Since v3.0.0.

print license information like a Debian copyright file; implies --copyright and --shortname-scheme=debian,spdx

--list-delimiter=PRINTF

Since v3.0.18.

printf-string used between multiple plain list items in Debian copyright file (default value: '\n ' (NEWLINE SPACE))

--rfc822-delimiter=PRINTF

Since v3.0.18.

printf-string used between multiple RFC822-style items in Debian copyright file (default value: '\n  ' (NEWLINE SPACE SPACE))

--[no-]merge-licenses

Since v3.0.0.

merge same-licensed files in Debian copyright file

General

-h, --help

print help message and exit

-v, --version

print version and copyright information and exit

--quiet, --verbose, --debug, --trace

Since v3.3.0.

Emit only error messages to STDERR (with option --quiet), or (in addition errors and warnings) also notices/debug/traces. The more "noisy" option wins if several are set. (default: emit errors and warnings

Environment

NO_COLOR

If defined, will disable color. Consulted before COLOR.

COLOR

Can be set to 0 to explicitly disable colors. The default is to use color when connected to a terminal.

LOG_LEVEL =item QUIET =item VERBOSE =item DEBUG =item TRACE

Used to emit varying details about discoveries to STDERR when verbosity is not set using either of options --quiet, --verbose, --debug or --trace. See Log::Any::Adapter::Screen for more details.

LOG_PREFIX

The default formatter groks these variables. See formatter in Log::Any::Adapter::Screen for more details.

Caveats

The exact output may change between releases, due to the inherently fragile scanning of unstructured data, and the ongoing improvements to detection patterns. For some level of stability, use one of the machine-readable output formats and define a --shortname-scheme.

Option --deb-fmt was deprecated since v3.2. Please use option --shortname-scheme=debian,spdx instead.

Releases

5 releases since Debian 9 (Stretch); the text changed 4 times.

  1. 9
  2. 10
  3. 11
  4. 12
  5. 13

--check since Debian 12 (Bookworm); --copyright since Debian 12 (Bookworm); --copyright-delimiter since Debian 12 (Bookworm); --debug since Debian 12 (Bookworm); --encoding since Debian 12 (Bookworm); --help since Debian 12 (Bookworm); --ignore since Debian 12 (Bookworm); --lines since Debian 12 (Bookworm); --list-delimiter since Debian 12 (Bookworm); --list-licenses since Debian 12 (Bookworm); --list-naming-schemes since Debian 12 (Bookworm); --machine since Debian 12 (Bookworm); --quiet since Debian 12 (Bookworm); --recursive since Debian 12 (Bookworm); --rfc822-delimiter since Debian 12 (Bookworm); --shortname-scheme since Debian 12 (Bookworm); --skipped since Debian 12 (Bookworm); --tail since Debian 12 (Bookworm); --trace since Debian 12 (Bookworm); --verbose since Debian 12 (Bookworm); --version since Debian 12 (Bookworm); -c since Debian 12 (Bookworm); -e since Debian 12 (Bookworm); -h since Debian 12 (Bookworm); -i since Debian 12 (Bookworm); -l since Debian 12 (Bookworm); -m since Debian 12 (Bookworm); -r since Debian 12 (Bookworm); -s since Debian 12 (Bookworm); -v since Debian 12 (Bookworm).

Author

Jonas Smedegaard "<[email protected]>"

From licensecheck 3.3.9-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.