All Available Options

This section contains an exhaustive list of all Scancode options, arranged in various sections. The sections are as follows:

  • basic
  • core
  • output-format
  • ouput-control
  • pre-scan
  • post-scan

The order of the sections and all their options is the same as in the :ref:’cli_help_text’, available in the command line.

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.

Extractcode Options

This is intended to be used as an input preperation step, before running the scan. Archives found inside an extracted archive are extracted recursively by default. Extraction is done in-place in a directory named ‘-extract’ side-by-side with an archive.

To extract the packages inside samples directory

./extractcode samples

This extracts the zlib.tar.gz package:

../../_images/extractcode.png
--shallow Do not extract recursively nested archives (e.g. not archives in archives).
--verbose Print verbose file-by-file progress messages.
--quiet Do not print any summary or progress message.
-h, --help Show the extractcode help message and exit.
--about Show information about ScanCode and licensing and exit.
--version Show the version and exit.

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.

Output Options

-f, --format <format>
 

Set <output_file> format to one of:

  • csv
  • html,
  • html-app,
  • json,
  • json-pp,
  • jsonlines,
  • spdx-rdf,
  • spdx-tv

or use <format> as the path to a custom template file.

By default, if nothing is specified, Output format is json.

Warning

In later versions, i.e. 3.x, this format changes significantly. Instead of this format, i.e. ./scancode --format html, a more concise format ./scancode --html is used.

Output Control Options

--strip-root Strip the root directory segment of all paths.
--full-root Report full, absolute paths.

Note

The options --strip-root and --full-root can’t be used together, i.e. any one option may be used in a single scan.

Note

The default is to always include the last directory segment of the scanned path such that all paths have a common root directory.

Pre-Scan Options

--ignore <pattern>
 Ignore files matching <pattern>.

Post-Scan Options

--mark-source Set the “is_source” flag to true for directories that contain over 90% of source files as direct children.

Note

The --mark-source option has no effect unless the --info scan is requested.

--only-findings
 Only return files or directories with findings for the requested scans. Files and directories without findings are omitted (not considering basic file information as findings).