Options
A deep dive into how options may be configured.
Option scopes
Options are partitioned into named scopes.
Some systemwide options belong in the global scope. For example, the --level
option, which controls the logging level, is in the global scope.
Other options belong to a subsystem scope. A subsystem is simply a collection of related options, in a scope. For example, the source
subsystem contains options related to source roots.
Setting options
Every option can be set in the following ways, in order of precedence:
- Via a command line flag.
- In an environment variable.
- In the config file.
If an option isn't set in one of these ways, it will take on a default value.
You can inspect both the current value and the default value by using ./pants help $scope
or ./pants help-advanced $scope
.
Command-line flags
Global options are set using an unqualified flag:
./pants --level=debug ...
Subsystem options are set by providing the flag, with the name prefixed with the lower-case scope name and a dash. So for the option --root-patterns
in the scope source
:
./pants --source-root-patterns="['^ext']"