LICENSECHECK(1p)
π LICENSECHECK π
okay bestie, so this is the manual page for LICENSECHECK(1p), and it lives in the User Contributed Perl Documentation section of the man pages. It's literally the cutest little detective that sniffs out which license applies to your source files. no cap. let's get into it π
β¨ NAME β¨
licensecheck β simple license checker for source files
π VERSION π
Version v3.3.9 β yes we're on v3.3.9, she's thriving π¦
π SYNOPSIS π
licensecheck [ --help | --version ]
licensecheck [ --list-licenses | --list-naming-schemes ]
licensecheck [OPTION...] PATH [PATH...]
three whole modes, three whole moods. pick your fighter β
π§ DESCRIPTION π§
so basically licensecheck tries to figure out which license applies to each file you hand it. how? she goes snooping at the start of the file, searching for text that belongs to all the various licenses. it's giving forensic investigator but make it β¨legalβ¨.
if any of the arguments you pass are directories, licensecheck will scoop up the files contained inside them and add those to the list of files to process. she's thorough like that π«Ά
and when you pass multiple PATHs? then only files that match --check and don't match --ignore actually get checked. rules are rules bestie π
π OPTIONS π
π Resolving patterns
--shortname-schemeβ Sincev3.2. a comma-separated priority list of license naming schemes to use for license identifiers. (default value: unset (which means use the verbose description instead))--list-licensesβ Sincev3.2. lists the identifiers for all the detectable licenses and then exits. window shopping but for license names β¨--list-naming-schemesβ Sincev3.2. lists all the available license naming schemes and exits. so many aesthetics to choose from π
ποΈ Selecting files
-cREGEX,--check=REGEXβ Sincev2.10.10. a regular expression of the files to include when more than onePATHis provided. (default value: common source files)-iREGEX,--ignore=REGEXβ Sincev2.10.10. a regular expression of the files to skip when more than onePATHis provided. (default value: some backup and VCS files β the messy ones, respectfully)-r,--recursiveβ Sincev2.10.7. traverses directories recursively. she goes deeper. she goes ALL the way down. periodt πΈ
π Parsing contents
-lN,--lines=Nβ Sincev2.10.3. the number of lines to parse from the top of each file. heads up: this implies an optimistic search that includes only the first cluster of detected copyrights or licenses. set it to0to parse the whole file (and in that case, ignore--tail). (default value:60)--tail=Nβ Sincev2.15.10. the number of bytes to parse from the bottom of each file β and this only kicks in when you're parsing from the top only and found nothing up there. set to0to avoid parsing from the end of the file at all (or set--linesto0and this setting gets ignored entirely). (default value:5000(roughly60lines))-eCODEC,--encoding=CODECβ Sincev2.15.10. try to decode the source files from the specified CODEC, with"iso-8859-1"as the fallback. (default value: unset (no decoding at all))
π Reporting results
--copyrightβ Sincev2.10.7. adds the copyright statements to the license information. receipts included π-s,--skippedβ Sincev3.3.0. logs files inPATHs that match neither--checknor--ignoreas warnings (by default they get logged as debug instead).-m,--machineβ Sincev2.12.2. prints the license information as"TAB"-separated fields, so you can feed it to line-oriented tools like"awk"and"sort". very much the "let the machines handle it" vibe π€--[no-]deb-machineβ Sincev3.0.0. prints the license information like a Debian copyright file. this implies--copyrightand--shortname-scheme=debian,spdx.--list-delimiter=PRINTFβ Sincev3.0.18. a printf-string used between multiple plain list items in the Debian copyright file. (default value:'\n '(NEWLINE SPACE))--rfc822-delimiter=PRINTFβ Sincev3.0.18. a printf-string used between multiple RFC822-style items in the Debian copyright file. (default value:'\n '(NEWLINE SPACE SPACE))--copyright-delimiter=PRINTFβ Sincev3.0.19. a printf-string used between years and owners in the Debian copyright file. (default value:', '(COMMA SPACE))--[no-]merge-licensesβ Sincev3.0.0. merges same-licensed files in the Debian copyright file. group them, they're a unit π«Ά
π General
-h,--helpβ prints the help message and exits. the classic π-v,--versionβ prints version and copyright information and exits.--quiet,--verbose,--debug,--traceβ Sincev3.3.0. emit only error messages toSTDERR(with option--quiet), or β in addition to errors and warnings β also notices/debug/traces. the more "noisy" option wins if several of them are set. (default: emit errors and warnings)
π¦ ENVIRONMENT π¦
NO_COLORβ if defined, it will disable color. it gets consulted beforeCOLOR. she asked first, respect the order bestie πCOLORβ can be set to0to explicitly disable colors. the default is to use color when connected to a terminal. if you're in a terminal, you get the β¨aestheticβ¨.LOG_LEVEL/QUIET/VERBOSE/DEBUG/TRACEβ these are used to emit varying details about discoveries toSTDERRwhen verbosity is not set using any of the options--quiet,--verbose,--debugor--trace. seeLog::Any::Adapter::Screenfor more details. πLOG_PREFIXβ the default formatter groks these variables. see formatter inLog::Any::Adapter::Screenfor more details.
π CAVEATS π
the exact output may change between releases β and that's because scanning unstructured data is inherently fragile, plus detection patterns keep getting improved. it's giving "we're working on it". if you want some level of stability, use one of the machine-readable output formats and define a --shortname-scheme. fr fr, protect your pipeline π«Ά
also: option --deb-fmt was deprecated since v3.2. please use option --shortname-scheme=debian,spdx instead. she's retired, let her rest π
πΈ SEE ALSO πΈ
other similar tools exist. obviously. the girlies stay competing π
here is a list of known tools that are also command-line based and general-purpose:
- copyright-update
<https://github.com/jaalto/project--copyright-update>β written in Perl. - debmake
<http://anonscm.debian.org/git/collab-maint/debmake.git>β written in Python. specific to Debian packages. - decopy
<https://anonscm.debian.org/git/collab-maint/decopy.git>β written in Python. - Licensee
<http://ben.balter.com/licensee/>β written in Ruby. - LicenseFinder
<https://github.com/pivotal/LicenseFinder>β written in Ruby. - ninka
<http://ninka.turingmachine.org/>β written in C++. used in FOSSology<http://fossology.org/>(along with Monk and Nomos, which are apparently unavailable as standalone command-line tools). - ripper
<https://github.com/odeke-em/ripper>β written in Go. - scancode-toolkit
<https://github.com/nexB/scancode-toolkit>β written in Python.
π 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>". shoutout to the originators π«Ά
Copyright Β© 2007, 2008 Adam D. Barratt
Copyright Β© 2012 Francesco Poli
Copyright Β© 2016-2022 Jonas Smedegaard
Copyright Β© 2017-2022 Purism SPC
this program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3, 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 Affero General Public License for more details.
you should have received a copy of the GNU Affero General Public License along with this program. if not, see <https://www.gnu.org/licenses/>.
okay that's the whole page bestie, you ate it π
this was LICENSECHECK(1p) as documented for perl v5.36.0, dated 2023-08-28 β go forth and license-check everything, mwah ππβ¨
π¦ where this page comes from
- ubuntu noble: licensecheck 3.3.9-1ubuntu1 Β· AGPL-3.0-or-later
- ubuntu questing: licensecheck 3.3.9-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms