Skip to content

Commit ff10b3d

Browse files
committed
Document command line flags and options
1 parent 070c2bd commit ff10b3d

File tree

1 file changed

+93
-31
lines changed

1 file changed

+93
-31
lines changed

doc/yaml_configuration.md

Lines changed: 93 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ resolver.
5757

5858
### resolver or snapshot
5959

60+
Command line equivalent (takes precedence): `--resolver` option
61+
6062
`resolver` and `snapshot` are synonyms. Only one of these keys is permitted, not
6163
both.
6264

@@ -220,6 +222,8 @@ For further information on the format for specifying dependencies, see the
220222

221223
Default: `{}`
222224

225+
Command line equivalent (takes precedence): `stack build --flag` option
226+
223227
Flags can be set for each package separately, e.g.
224228

225229
```yaml
@@ -281,6 +285,8 @@ user-message: ! 'Warning: Some packages were found to be incompatible with the r
281285

282286
Default: `[]`
283287

288+
Command line equivalent: `--customer-preprocessor-extensions` option
289+
284290
In order for Stack to be aware of any custom preprocessors you are using, add
285291
their extensions here
286292

@@ -301,9 +307,11 @@ options below are listed in alphabetic order.
301307

302308
(Since 1.0.1)
303309

310+
Restrictions: POSIX systems only.
311+
304312
Default: `false`
305313

306-
Restrictions: POSIX systems only.
314+
Command line equivalent (takes precedence): `--[no-]allow-different-user` flag
307315

308316
Allow users other than the owner of the Stack root to use the Stack
309317
installation.
@@ -352,12 +360,16 @@ about your snapshot database.
352360

353361
### arch
354362

355-
Set the architecture for GHC, build directories, etc. Values are those
356-
recognized by Cabal, e.g.:
363+
Default: The machine architecture on which Stack is running.
364+
365+
Command line equivalent (takes precedence): `--arch` option
357366

358-
arch: i386, x86_64
367+
Stack identifies different GHC executables by platform (operating system and
368+
machine architecture), (optional) GHC variant and (optional) GHC build.
369+
See [`setup-info`](#setup-info).
359370

360-
This can also be set via the command line.
371+
`arch` sets the machine architecture. Values are those recognized by Cabal,
372+
including `x86_64`, `i386` and `aarch64`.
361373

362374
### build
363375

@@ -412,6 +424,8 @@ build:
412424
ddump-dir: ""
413425
```
414426

427+
Command line equivalents (take precedence): Yes, see below.
428+
415429
Allows setting build options which are usually specified on the command line.
416430

417431
The meanings of these settings correspond directly with the command line flags
@@ -421,22 +435,22 @@ of the same name. For further information, see the
421435

422436
### color
423437

438+
Command line equivalent (takes precedence): `--color` option
439+
424440
This option specifies when to use color in output. The option is used as
425441
`color: <WHEN>`, where `<WHEN>` is 'always', 'never', or 'auto'. On Windows
426442
versions before Windows 10, for terminals that do not support color codes, the
427443
default is 'never'; color may work on terminals that support color codes.
428444

429-
The color use can also be set at the command line using the equivalent
430-
`--color=<WHEN>` global option. Color use set at the command line takes
431-
precedence over that set in a yaml configuration file.
432-
433445
(The British English spelling (colour) is also accepted. In yaml configuration
434446
files, the American spelling is the alternative that has priority.)
435447

436448
### compiler
437449

438450
(Since 0.1.7)
439451

452+
Command line equivalent (takes precedence): `--compiler` option
453+
440454
Overrides the compiler version in the resolver. Note that the `compiler-check`
441455
flag also applies to the version numbers. This uses the same syntax as compiler
442456
resolvers like `ghc-9.2.4`. This can be used to override the
@@ -591,6 +605,9 @@ repository. See the output of `stack templates`.
591605

592606
### docker
593607

608+
Command line equivalents: `--docker-*` flags and options (see
609+
`stack --docker-help` for details).
610+
594611
For further information, see the
595612
[Docker integration](docker_integration.md#configuration) documentation.
596613

@@ -600,6 +617,8 @@ For further information, see the
600617

601618
Default: `warning`
602619

620+
Command line equivalent (takes precedence): `--[no-]dump-logs` flag
621+
603622
Control which log output from local non-dependency packages to print to the
604623
console. By default, Stack will only do this when building a single target
605624
package or if the log contains warnings, to avoid generating unnecessarily
@@ -615,6 +634,9 @@ dump-logs: all # dump all logs for local non-dependency packages
615634

616635
Default: `[]`
617636

637+
Command line equivalent: `--extra-include-dirs` option (repeat for each
638+
directory)
639+
618640
A list of extra paths to be searched for header files. Paths should be absolute
619641

620642
```yaml
@@ -631,6 +653,8 @@ may well make sense to include these there as well.
631653

632654
Default: `[]`
633655

656+
Command line equivalent: `--extra-lib-dirs` option (repeat for each directory)
657+
634658
A list of extra paths to be searched for libraries. Paths should be absolute
635659

636660
```yaml
@@ -640,7 +664,7 @@ extra-lib-dirs:
640664

641665
Since these are system-dependent absolute paths, it is recommended that you
642666
specify these in your `config.yaml` file. If you control the build environment
643-
in your project's ``stack.yaml``, perhaps through docker or other means, then it
667+
in your project's ``stack.yaml``, perhaps through Docker or other means, then it
644668
may well make sense to include these there as well.
645669

646670
### extra-path
@@ -666,10 +690,18 @@ compiler's binary directory - will take precedence over those specified here
666690

667691
(Since 1.3.0)
668692

669-
Specify a specialized architecture bindist to use. Normally this is
670-
determined automatically, but you can override the autodetected value here.
671-
Possible arguments include `standard`, `gmp4`, `nopie`, `tinfo6`,
672-
`tinfo6-nopie`, `ncurses6`, and `integersimple`.
693+
Default: `standard`
694+
695+
Command line equivalent (takes precedence): `--ghc-build` option
696+
697+
Stack identifies different GHC executables by platform (operating system and
698+
machine architecture), (optional) GHC variant and (optional) GHC build.
699+
See [`setup-info`](#setup-info).
700+
701+
`ghc-build` specifies a specialized architecture for the GHC executable.
702+
Normally this is determined automatically, but it can be overriden. Possible
703+
arguments include `standard`, `gmp4`, `nopie`, `tinfo6`, `tinfo6-nopie`,
704+
`ncurses6`, and `integersimple`.
673705

674706
### ghc-options
675707

@@ -710,7 +742,13 @@ expressive, keys.
710742

711743
Default: `standard`
712744

713-
Specify a variant binary distribution of GHC to use. Known values:
745+
Command line equivalent (takes precedence): `--ghc-variant` option
746+
747+
Stack identifies different GHC executables by platform (operating system and
748+
machine architecture), (optional) GHC variant and (optional) GHC build.
749+
See [`setup-info`](#setup-info).
750+
751+
`ghc-variant` specifies a variant of the GHC executable. Known values are:
714752

715753
* `standard`: Use the standard GHC binary distribution
716754
* `integersimple`: Use a GHC bindist that uses
@@ -779,15 +817,18 @@ will receive a warning if this configuration value is set.
779817

780818
Default: `true` (since 1.5.0)
781819

820+
Command line equivalent (takes precedence): `--[no-]install-ghc` flag
821+
782822
Whether or not to automatically install GHC when necessary.
783823

784824
### jobs
785825

786826
Default: the number of processors reported by your CPU.
787827

788-
Specifies how many build tasks should be run in parallel. This can be overloaded
789-
on the command line via `-jN`, for example `-j2`. One usage for this might be to
790-
avoid running out of memory by setting it to 1, like this:
828+
Command line equivalent (takes precedence): `-j`, `--jobs` option
829+
830+
Specifies how many build tasks should be run in parallel. One usage for this
831+
might be to avoid running out of memory by setting it to 1, like this:
791832

792833
```yaml
793834
jobs: 1
@@ -799,6 +840,8 @@ Default (on Unix-like operating systems): `~/.local/bin`
799840

800841
Default (on Windows): `%APPDATA%\local\bin`
801842

843+
Command line equivalent (takes precedence): `--local-bin-path` option
844+
802845
Target directory for `stack install` and `stack build --copy-bins`.
803846

804847
### local-programs-path
@@ -830,9 +873,13 @@ Hackage that make use of `configure` are `network` and `process`.
830873

831874
(Since 0.1.6)
832875

876+
Restrictions: Windows systems only.
877+
833878
Default: `true`
834879

835-
Whether to modify the code page for UTF-8 output when running on Windows.
880+
Command line equivalent (takes precedence): `--[no-]modify-code-page` flag
881+
882+
Whether to modify the code page for UTF-8 output.
836883

837884
```yaml
838885
modify-code-page: false
@@ -855,6 +902,9 @@ nix:
855902
shell-file:
856903
~~~
857904

905+
Command line equivalents: `--nix-*` flags and options (see `stack --nix-help`
906+
for details).
907+
858908
For further information, see the
859909
[Nix integration](nix_integration.md#configuration) documentation.
860910

@@ -1077,6 +1127,8 @@ setup-info-locations: []
10771127

10781128
(Since 2.3)
10791129

1130+
Command line equivalent (takes precedence): `--setup-info-yaml` option
1131+
10801132
By way of introduction, see the [`setup-info`](#setup-info) option. This option
10811133
specifies the location(s) of `setup-info` dictionaries.
10821134

@@ -1158,16 +1210,20 @@ ghc:
11581210

11591211
Default: `false`
11601212

1213+
Command line equivalent (takes precedence): `--[no-]skip-ghc-check` flag
1214+
11611215
Should we skip the check to confirm that your system GHC version (on the PATH)
11621216
matches what your project expects?
11631217

11641218
### skip-msys
11651219

11661220
(Since 0.1.2.0)
11671221

1222+
Restrictions: Windows systems only
1223+
11681224
Default: `false`
11691225

1170-
Restrictions: Windows systems only
1226+
Command line equivalent (takes precedence): `--[no-]skip-msys` flag
11711227

11721228
Skips checking for and installing MSYS2 when stack is Setting up the
11731229
environment. This usually doesn't make sense in project-level configurations,
@@ -1184,6 +1240,8 @@ skip-msys: true
11841240
Default: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/
11851241
(as set in the `pantry` library)
11861242

1243+
Command line equivalent (takes precedence): `--snapshot-location-base` option
1244+
11871245
Sets the base location of the LTS Haskell or Stackage Nightly snapshots.
11881246

11891247
For example:
@@ -1206,6 +1264,8 @@ then use a custom `snapshot-location-base` in the closed environments only.
12061264

12071265
### stack-colors
12081266

1267+
Command line equivalent (takes precedence): `--stack-colors` option
1268+
12091269
Stack uses styles to format some of its output. The default styles do not work
12101270
well with every terminal theme. This option specifies Stack's output styles,
12111271
allowing new styles to replace the defaults. The option is used as
@@ -1232,11 +1292,8 @@ terminal theme might wish to set the styles as follows:
12321292
```yaml
12331293
stack-colors: error=31:good=32:shell=35:dir=34:recommendation=32:target=95:module=35:package-component=95:secondary=92:highlight=32
12341294
```
1235-
The styles can also be set at the command line using the equivalent
1236-
`--stack-colors=<STYLES>` global option. Styles set at the command line take
1237-
precedence over those set in a YAML configuration file. (In respect of styles
1238-
used in verbose output, some of that output occurs before the configuration file
1239-
is processed.)
1295+
In respect of styles used in verbose output, some of that output occurs before
1296+
the configuration file is processed.
12401297

12411298
(The British English spelling (colour) is also accepted. In YAML configuration
12421299
files, the American spelling is the alternative that has priority.)
@@ -1261,6 +1318,8 @@ stack-developer-mode: false
12611318
Default: `false`, unless the [Docker](docker_integration.md) or
12621319
[Nix](nix_integration.md) integration is enabled.
12631320

1321+
Command line equivalent (takes precedence): `--[no-]system-ghc` flag
1322+
12641323
Enables or disables using the GHC available on the PATH. (Make sure PATH is
12651324
explicit, i.e., don't use ~.) Useful to enable if you want to save the time,
12661325
bandwidth or storage space needed to setup an isolated GHC.
@@ -1343,6 +1402,8 @@ Customize the URLs where Stack looks for snapshot build plans.
13431402

13441403
### with-gcc
13451404

1405+
Command line equivalent (takes precedence): `--with-gcc` option
1406+
13461407
Specify a path to GCC explicitly, rather than relying on the normal path
13471408
resolution.
13481409

@@ -1352,6 +1413,8 @@ with-gcc: /usr/local/bin/gcc-5
13521413

13531414
### with-hpack
13541415

1416+
Command line equivalent (takes precedence): `--with-hpack` option
1417+
13551418
Use an [Hpack](https://github.com/sol/hpack) executable, rather than Stack's
13561419
in-built version of the Hpack functionality.
13571420

@@ -1365,10 +1428,9 @@ with-hpack: /usr/local/bin/hpack
13651428

13661429
Default: `.stack-work`
13671430

1368-
This key specifies the relative path of Stack's 'work' directory. This can also
1369-
be specified by an environment variable or on the command line. The earlier
1370-
items in the list below take precedence:
1431+
Command line equivalent (takes precedence): `--work-dir` option
1432+
1433+
Environment variable alternative (lowest precedence): `STACK_WORK`
13711434

1372-
1. `--work-dir DIR` passed on the command line
1373-
2. `work-dir` in a YAML configuration file
1374-
3. `STACK_WORK` environment variable
1435+
`work-dir` (or the contents of `STACK_WORK`) specifies the relative path of
1436+
Stack's 'work' directory.

0 commit comments

Comments
 (0)