Fork me on GitHub

Command Line Options

The RAT command line has a number of options. RAT is a command line first project. All new functionality is introduced via command line options before being implemented in other clients/UIs.

The argument types specified in the list below are defined in section following.

The Options

-a

Deprecated for removal since 0.17: Use edit-license instead.

  • Required: false
  • Example: -a

--addLicense or -A

Deprecated for removal since 0.17: Use edit-license instead. Add the Apache-2.0 license header to any file with an unknown license that is not in the exclusion list.

  • Required: false
  • Example: --addLicense

--config

File names for system configuration.

  • Required: false
  • Argument Type: <File>
  • Argument Count: Unlimited. Unlimited arguments must end with `--` or another option starting with `--`.
  • Example: --config File [File2 [File3 [...]]] --

--configuration-no-defaults

Ignore default configuration.

  • Required: false
  • Example: --configuration-no-defaults

--copyright or -c

Deprecated for removal since 0.17: Use edit-copyright instead. The copyright message to use in the license headers.

  • Required: false
  • Argument Type: <Arg>
  • Argument Count: 1
  • Example: --copyright Arg

--counter-max

The acceptable maximum number for the specified counter. A value of '-1' specifies an unlimited number.

  • Required: false
  • Argument Type: <CounterPattern>
  • Argument Count: Unlimited. Unlimited arguments must end with `--` or another option starting with `--`.
  • Example: --counter-max CounterPattern [CounterPattern2 [CounterPattern3 [...]]] --

--counter-min

The minimum number for the specified counter.

  • Required: false
  • Argument Type: <CounterPattern>
  • Argument Count: Unlimited. Unlimited arguments must end with `--` or another option starting with `--`.
  • Example: --counter-min CounterPattern [CounterPattern2 [CounterPattern3 [...]]] --

--dir or -d

Deprecated for removal since 0.17: Use the standard '--' to signal the end of arguments. Used to indicate end of list when using options that take multiple arguments.

  • Required: false
  • Argument Type: <DirOrArchive>
  • Argument Count: 1
  • Example: --dir DirOrArchive

--dry-run

If set do not update the files but generate the reports.

  • Required: false
  • Example: --dry-run

--edit-copyright

The copyright message to use in the license headers. Usually in the form of "Copyright 2008 Foo". Only valid with --edit-license

  • Required: false
  • Argument Type: <Arg>
  • Argument Count: 1
  • Example: --edit-copyright Arg

--edit-license

Add the Apache-2.0 license header to any file with an unknown license that is not in the exclusion list. By default new files will be created with the license header, to force the modification of existing files use the --edit-overwrite option.

  • Required: false
  • Example: --edit-license

--edit-overwrite

Forces any changes in files to be written directly to the source files so that new files are not created. Only valid with --edit-license.

  • Required: false
  • Example: --edit-overwrite

--exclude or -e

Deprecated for removal since 0.17: Use input-exclude instead. Excludes files matching <Expression>.

  • Required: false
  • Argument Type: <Expression>
  • Argument Count: Unlimited. Unlimited arguments must end with `--` or another option starting with `--`.
  • Example: --exclude Expression [Expression2 [Expression3 [...]]] --

--exclude-file or -E

Deprecated for removal since 0.17: Use input-exclude-file instead. Reads <Expression> entries from a file. Entries will be excluded from processing.

  • Required: false
  • Argument Type: <File>
  • Argument Count: 1
  • Example: --exclude-file File

--force or -f

Deprecated for removal since 0.17: Use edit-overwrite instead. Forces any changes in files to be written directly to the source files so that new files are not created.

  • Required: false
  • Example: --force

--help or -?

Print help for the RAT command line interface and exit.

  • Required: false
  • Example: --help

--help-licenses

Print information about registered licenses.

  • Required: false
  • Example: --help-licenses

--include

Deprecated for removal since 0.17: Use input-include instead. Includes files matching <Expression>. Will override excluded files.

  • Required: false
  • Argument Type: <Expression>
  • Argument Count: Unlimited. Unlimited arguments must end with `--` or another option starting with `--`.
  • Example: --include Expression [Expression2 [Expression3 [...]]] --

--includes-file

Deprecated for removal since 0.17: Use input-include-file instead. Reads <Expression> entries from a file. Entries will be excluded from processing.

  • Required: false
  • Argument Type: <File>
  • Argument Count: 1
  • Example: --includes-file File

--input-exclude

Excludes files matching <Expression>.

  • Required: false
  • Argument Type: <Expression>
  • Argument Count: Unlimited. Unlimited arguments must end with `--` or another option starting with `--`.
  • Example: --input-exclude Expression [Expression2 [Expression3 [...]]] --

--input-exclude-file

Reads <Expression> entries from a file. Entries will be excluded from processing.

  • Required: false
  • Argument Type: <File>
  • Argument Count: 1
  • Example: --input-exclude-file File

--input-exclude-parsed-scm

Parse SCM based exclusion files to exclude specified files and directories. This action can apply to any standard collection that implements a file processor.

  • Required: false
  • Argument Type: <StandardCollection>
  • Argument Count: Unlimited. Unlimited arguments must end with `--` or another option starting with `--`.
  • Example: --input-exclude-parsed-scm StandardCollection [StandardCollection2 [StandardCollection3 [...]]] --

--input-exclude-size

Excludes files with sizes less than the number of bytes specified.

  • Required: false
  • Argument Type: <Integer>
  • Argument Count: 1
  • Example: --input-exclude-size Integer

--input-exclude-std

Excludes files defined in standard collections based on commonly occurring groups. Excludes any path matcher actions but DOES NOT exclude any file processor actions.

  • Required: false
  • Argument Type: <StandardCollection>
  • Argument Count: Unlimited. Unlimited arguments must end with `--` or another option starting with `--`.
  • Example: --input-exclude-std StandardCollection [StandardCollection2 [StandardCollection3 [...]]] --

--input-include

Includes files matching <Expression>. Will override excluded files.

  • Required: false
  • Argument Type: <Expression>
  • Argument Count: Unlimited. Unlimited arguments must end with `--` or another option starting with `--`.
  • Example: --input-include Expression [Expression2 [Expression3 [...]]] --

--input-include-file

Reads <Expression> entries from a file. Entries will override excluded files.

  • Required: false
  • Argument Type: <File>
  • Argument Count: 1
  • Example: --input-include-file File

--input-include-std

Includes files defined in standard collections based on commonly occurring groups. Includes any path matcher actions but DOES NOT include any file processor actions.

  • Required: false
  • Argument Type: <StandardCollection>
  • Argument Count: Unlimited. Unlimited arguments must end with `--` or another option starting with `--`.
  • Example: --input-include-std StandardCollection [StandardCollection2 [StandardCollection3 [...]]] --

--input-source

A file containing file names to process. File names must use linux directory separator ('/') or none at all. File names that do not start with '/' are relative to the directory where the argument is located.

  • Required: false
  • Argument Type: <File>
  • Argument Count: Unlimited. Unlimited arguments must end with `--` or another option starting with `--`.
  • Example: --input-source File [File2 [File3 [...]]] --

--license-families-approved

A comma separated list of approved license family IDs. These license families will be added to the list of approved license families.

  • Required: false
  • Argument Type: <FamilyID>
  • Argument Count: 1
  • Example: --license-families-approved FamilyID

--license-families-approved-file

Name of file containing comma separated lists of approved family IDs.

  • Required: false
  • Argument Type: <File>
  • Argument Count: 1
  • Example: --license-families-approved-file File

--license-families-denied

A comma separated list of denied License family IDs. These license families will be removed from the list of approved licenses. Once license families are removed they can not be added back.

  • Required: false
  • Argument Type: <FamilyID>
  • Argument Count: 1
  • Example: --license-families-denied FamilyID

--license-families-denied-file

Name of file containing comma separated lists of denied license IDs. These license families will be removed from the list of approved licenses. Once license families are removed they can not be added back.

  • Required: false
  • Argument Type: <File>
  • Argument Count: 1
  • Example: --license-families-denied-file File

--licenses

Deprecated for removal since 0.17: Use config instead. File names for system configuration.

  • Required: false
  • Argument Type: <File>
  • Argument Count: Unlimited. Unlimited arguments must end with `--` or another option starting with `--`.
  • Example: --licenses File [File2 [File3 [...]]] --

--licenses-approved

A comma separated list of approved License IDs. These licenses will be added to the list of approved licenses.

  • Required: false
  • Argument Type: <LicenseID>
  • Argument Count: 1
  • Example: --licenses-approved LicenseID

--licenses-approved-file

Name of file containing comma separated lists of approved License IDs.

  • Required: false
  • Argument Type: <File>
  • Argument Count: 1
  • Example: --licenses-approved-file File

--licenses-denied

A comma separated list of denied License IDs. These licenses will be removed from the list of approved licenses. Once licenses are removed they can not be added back.

  • Required: false
  • Argument Type: <LicenseID>
  • Argument Count: 1
  • Example: --licenses-denied LicenseID

--licenses-denied-file

Name of file containing comma separated lists of the denied license IDs. These licenses will be removed from the list of approved licenses. Once licenses are removed they can not be added back.

  • Required: false
  • Argument Type: <File>
  • Argument Count: 1
  • Example: --licenses-denied-file File

--list-families

Deprecated for removal since 0.17: Use output-families instead. List the defined license families.

  • Required: false
  • Argument Type: <LicenseFilter>
  • Argument Count: 1
  • Example: --list-families LicenseFilter

--list-licenses

Deprecated for removal since 0.17: Use output-licenses instead. List the defined licenses.

  • Required: false
  • Argument Type: <LicenseFilter>
  • Argument Count: 1
  • Example: --list-licenses LicenseFilter

--log-level

Sets the log level.

  • Required: false
  • Argument Type: <LogLevel>
  • Argument Count: 1
  • Example: --log-level LogLevel

--no-default-licenses

Deprecated for removal since 0.17: Use configuration-no-defaults instead. Ignore default configuration.

  • Required: false
  • Example: --no-default-licenses

--out or -o

Deprecated for removal since 0.17: Use output-file instead. Define the output file where to write a report to.

  • Required: false
  • Argument Type: <File>
  • Argument Count: 1
  • Example: --out File

--output-archive

Specifies the level of detail in ARCHIVE file reporting.

  • Required: false
  • Argument Type: <ProcessingType>
  • Argument Count: 1
  • Example: --output-archive ProcessingType

--output-families

List the defined license families.

  • Required: false
  • Argument Type: <LicenseFilter>
  • Argument Count: 1
  • Example: --output-families LicenseFilter

--output-file

Define the output file where to write a report to.

  • Required: false
  • Argument Type: <File>
  • Argument Count: 1
  • Example: --output-file File

--output-licenses

List the defined licenses.

  • Required: false
  • Argument Type: <LicenseFilter>
  • Argument Count: 1
  • Example: --output-licenses LicenseFilter

--output-standard

Specifies the level of detail in STANDARD file reporting.

  • Required: false
  • Argument Type: <ProcessingType>
  • Argument Count: 1
  • Example: --output-standard ProcessingType

--output-style

XSLT stylesheet to use when creating the report. Either an external xsl file may be specified or one of the internal named sheets.

  • Required: false
  • Argument Type: <StyleSheet>
  • Argument Count: 1
  • Example: --output-style StyleSheet

--scan-hidden-directories

Deprecated for removal since 0.17: Use input-include-std with 'HIDDEN_DIR' argument instead. Scans hidden directories.

  • Required: false
  • Example: --scan-hidden-directories

--stylesheet or -s

Deprecated for removal since 0.17: Use output-style instead. XSLT stylesheet to use when creating the report.

  • Required: false
  • Argument Type: <StyleSheet>
  • Argument Count: 1
  • Example: --stylesheet StyleSheet

--xml or -x

Deprecated for removal since 0.17: Use output-style with the 'xml' argument instead. forces XML output rather than the textual report.

  • Required: false
  • Example: --xml

Argument Types

<Arg>

A string

<CounterPattern>

A pattern comprising one of the following prefixes followed by a colon and a count (e.g. UNAPPROVED:5). Prefixes are

  • APPROVED: A count of approved licenses. Default range [0, unlimited]
  • ARCHIVES: A count of archive files. Default range [0, unlimited]
  • BINARIES: A count of binary files. Default range [0, unlimited]
  • DOCUMENT_TYPES: A count of distinct document types. Default range [1, unlimited]
  • IGNORED: A count of ignored files. Default range [0, unlimited]
  • LICENSE_CATEGORIES: A count of distinct license categories. Default range [1, unlimited]
  • LICENSE_NAMES: A count of distinct license names. Default range [1, unlimited]
  • NOTICES: A count of notice files. Default range [0, unlimited]
  • STANDARDS: A count of standard files. Default range [1, unlimited]
  • UNAPPROVED: A count of unapproved licenses. Default range [0, 0]
  • UNKNOWN: A count of unknown file types. Default range [0, unlimited]

.

<DirOrArchive>

A directory or archive file to scan.

<Expression>

A file matching pattern usually of the form used in Ant build files and '.gitignore' files (see https://ant.apache.org/manual/dirtasks.html#patterns for examples). Regular expression patterns may be specified by surrounding the pattern with '%regex[' and ']'. For example '%regex[[A-Z].*]' would match files and directories that start with uppercase latin letters.

<FamilyID>

The ID for a license family.

<File>

A file name.

<Integer>

An integer value.

<LicenseFilter>

A defined filter for the licenses to include. Valid values: ALL, APPROVED, NONE.

<LicenseID>

The ID for a license.

<LogLevel>

The log level to use. Valid values DEBUG, INFO, WARN, ERROR, OFF.

<ProcessingType>

Specifies how to process file types. Valid values are: * NOTIFICATION: List file as present

  • PRESENCE: List any licenses found
  • ABSENCE: List licenses found and any unknown licences

<StandardCollection>

Defines standard expression patterns (see above). Valid values are:

  • ALL: All of the Standard Excludes combined.
  • ARCH: The files and directories created by an ARCH source code control based tool.
  • BAZAAR: The files and directories created by a Bazaar source code control based tool.
  • BITKEEPER: The files and directories created by a Bitkeeper source code control based tool.
  • CVS: The files and directories created by a CVS source code control based tool.
  • DARCS: The files and directories created by a DARCS source code control based tool.
  • ECLIPSE: The files and directories created by an Eclipse IDE based tool.
  • GIT: The files and directories created by GIT source code control to support GIT, also processes files listed in '.gitignore' and (unless RAT_NO_GIT_GLOBAL_IGNORE is specified) the global gitignore.
  • HIDDEN_DIR: The hidden directories. Directories with names that start with '.'
  • HIDDEN_FILE: The hidden files. Directories with names that start with '.'
  • IDEA: The files and directories created by an IDEA IDE based tool.
  • MAC: The .DS_Store files on Mac computers.
  • MAVEN: The files and directories created by Maven build system based project.
  • MERCURIAL: The files and directories created by a Mercurial source code control based tool.
  • MISC: The set of miscellaneous files generally left by editors and the like.
  • MKS: The files and directories created by an MKS source code control based tool.
  • RCS: The files and directories created by a RCS source code control based tool.
  • SCCS: The files and directories created by a SCCS source code control based tool.
  • SERENA_DIMENSIONS_10: The files and directories created by a Serena Dimensions V10 change control system based tool.
  • STANDARD_PATTERNS: A standard collection of generally accepted patterns to ignore.
  • STANDARD_SCMS: A standard collection of SCMs
  • SUBVERSION: The files and directories created by a Subversion source code control based tool.
  • SURROUND_SCM: The files and directories created by a Surround SCM source code control based tool.
  • VSS: The files and directories created by a Visual Source Safe source code control based tool.

A complete description of each of the standard collection types is available.

<StyleSheet>

Either an external xsl file or one of the internal named sheets. Internal sheets are:

  • plain-rat: The default style.
  • missing-headers: Produces a report of files that are missing headers.
  • unapproved-licenses: Produces a report of the files with unapproved licenses.
  • xml: Produces output in pretty-printed XML.