Skip to content

Commit

Permalink
Fix #6326 Document arguments parser
Browse files Browse the repository at this point in the history
  • Loading branch information
mpilgrem committed Nov 1, 2023
1 parent fbcd253 commit 8fbb815
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
31 changes: 29 additions & 2 deletions doc/build_command.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,13 @@ sets this flag.

### `--haddock-arguments` option

`stack haddock --haddock-arguments <haddock_arguments>` passes the specified
`stack haddock --haddock-arguments <haddock_argument(s)>` passes the specified
arguments to the Haddock tool.

Specified arguments are separated by spaces. Arguments can be unquoted (if they
do not contain space or `"` characters) or quoted (`""`). Quoted arguments can
include 'escaped' characters, escaped with an initial `\` character.

### `--[no-]haddock-deps` flag

Default: Enabled (if building Haddock documnentation)
Expand Down Expand Up @@ -336,11 +340,34 @@ project packages or from local dependencies). See also the `--file-watch` flag.

## Controlling what happens after building

### `--benchmark-arguments`, `--ba` option

`stack build --bench --benchmark-arguments=<argument(s)>` will pass the
specified argument, or arguments, to each benchmark when it is run.

Specified arguments are separated by spaces. Arguments can be unquoted (if they
do not contain space or `"` characters) or quoted (`""`). Quoted arguments can
include 'escaped' characters, escaped with an initial `\` character.

### `--exec` option

`stack build --exec "<command> [<arguments>]"` will run the specified command
`stack build --exec "<command> [<argument(s)>]"` will run the specified command
after a successful build.

Specified arguments are separated by spaces. Arguments can be unquoted (if they
do not contain space or `"` characters) or quoted (`""`). Quoted arguments can
include 'escaped' characters, escaped with an initial `\` character.

### `--test-arguments`, `--ta` option

`stack build --test --test-arguments=<argument(s)>` will pass the specified
argument, or arguments, to each test when it is run. This option can be
specified multiple times.

Specified arguments are separated by spaces. Arguments can be unquoted (if they
do not contain space or `"` characters) or quoted (`""`). Quoted arguments can
include 'escaped' characters, escaped with an initial `\` character.

## Flags affecting GHC's behaviour

### `--[no-]executable-profiling` flag
Expand Down
10 changes: 8 additions & 2 deletions doc/exec_command.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@ By default:
`--cwd <directory>` to execute the executable in the specified directory.

The option `--package <package>` has no effect for the `stack exec` command. For
further information about its use, see the [`stack ghc` command](ghc_command.md) documentation or the [`stack runghc` command](runghc_command.md) documentation.
further information about its use, see the [`stack ghc` command](ghc_command.md)
documentation or the [`stack runghc` command](runghc_command.md) documentation.

Pass the option `--rts-option <rts_flag>` to specify a GHC RTS flag or option.
Pass the option `--rts-option <rts_flag(s)>` to specify a GHC RTS flag or option.
The option can be specified multiple times. All specified GHC RTS flags and
options are added to the arguments for the specified executable between
arguments `+RTS` and `-RTS`.

Specified GHC RTS flags and options are separated by spaces. Items can be
unquoted (if they do not contain space or `"` characters) or quoted (`""`).
Quoted items can include 'escaped' characters, escaped with an initial `\`
character.

0 comments on commit 8fbb815

Please sign in to comment.