Core Options

Basic Scan Type Options

Option lists are two-column lists of command-line options and descriptions, documenting a program’s options. For example:

-c, --copyright
 Scan <input> for copyrights. [default]
-l, --license Scan <input> for licenses. [default]
-p, --package Scan <input> for packages. [default]
-e, --email Scan <input> for emails.
-u, --url Scan <input> for urls.
-i, --info

Include information such as:

  • size,
  • type,
  • date,
  • programming language,
  • sha1 and md5 hashes,
  • is/isn’t binary/text/archive/media/source/script

etc.

Note

Options -c, -l, and -p are default, but only if none of the six options (i.e. -c, -l, -p, -e, -u and -i) are used explicitly. If any of combination of these options are used, scancode only performs that specific task, and not the others. ./scancode -e only scans for emails, and doesn’t scan for copyright/license/packages/general information.

Note

These options, i.e. -c, -l, -p, -e, -u, and -i can be used together. As in, instead of ./scancode -c -i -p, you can write ./scancode -cip and it will be the same.

--license-score INTEGER
 

Do not return license matches with scores lower than this score.

A number between 0 and 100. [default: 0] Here, a bigger number means a better match, i.e. setting a higher license score translates to a higher threshold (with equal or less number of matches).

--license-text Include the matched text for the detected licenses with the output report.
--license-url-template TEXT
 

Set the template URL used for the license reference URLs.

In a template URL, curly braces ({}) are replaced by the license key. [default: https://enterprise.dejacode.com/urn/urn:dje:license:{}]

Note

These 3 options, --license-score, --license-text, and --license-url-template doesn’t have any effect unless --license is requested.

Core Options

-n, --processes INTEGER
 Scan <input> using n parallel processes. [default: 1]
--verbose Print verbose file-by-file progress messages.
--quiet Do not print summary or progress messages.
--diag Include additional diagnostic information such as error messages or result details.
--timeout FLOAT
 Stop scanning a file if scanning takes longer than a timeout in seconds. [default: 120]
--reindex-licenses
 Force a check and possible reindexing of the cached license index.

Documentation/Help Options

-h, --help Show the Help text and exit.
--examples Show the Command Examples Text and exit.
--about Show information about ScanCode and licensing and exit.
--version Show the version and exit.

Comparing Progress Message Options

Default Progress Message:

Scanning files for: infos, licenses, copyrights, packages, emails, urls with 1 process(es)...
Building license detection index...Done.
Scanning files...
[####################] 43
Scanning done.
Scan statistics: 43 files scanned in 33s.
Scan options:    infos, licenses, copyrights, packages, emails, urls with 1 process(es).
Scanning speed:  1.4 files per sec.
Scanning time:   30s.
Indexing time:   2s.
Saving results.

Progress Message with --verbose:

Scanning files for: infos, licenses, copyrights, packages, emails, urls with 1 process(es)...
Building license detection index...Done.
Scanning files...
Scanned: screenshot.png
Scanned: README
...
Scanned: zlib/dotzlib/ChecksumImpl.cs
Scanned: zlib/dotzlib/readme.txt
Scanned: zlib/gcc_gvmat64/gvmat64.S
Scanned: zlib/ada/zlib.ads
Scanned: zlib/infback9/infback9.c
Scanned: zlib/infback9/infback9.h
Scanned: arch/zlib.tar.gz
Scanning done.
Scan statistics: 43 files scanned in 29s.
Scan options:    infos, licenses, copyrights, packages, emails, urls with 1 process(es).
Scanning speed:  1.58 files per sec.
Scanning time:   27s.
Indexing time:   2s.
Saving results.

With the --quiet option enabled, nothing is printed on the Command Line.

--timeout Option

This option sets scan timeout for each file (and not the entire scan). If some file scan exceeds the specified timeout, that file isn’t scanned anymore and the next file scanning starts. This helps avoiding very large/long files, and saves time.

Also the number(timeout in seconds) to be followed by this option can be a floating point number, i.e. 1.5467.