Skip to content

Commit

Permalink
Re #6466 Add --snapshot as synonym for --resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
mpilgrem committed Jan 31, 2024
1 parent 5026a37 commit 25a7a2a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 16 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ Other enhancements:
* Add option `--filter <item>` to Stack's `ls dependencies text` command to
filter out an item from the results, if present. The item can be `$locals` for
all local packages.
* Add option `--snapshot` as synonym for `--resolver`.

Bug fixes:

Expand Down
29 changes: 18 additions & 11 deletions doc/global_flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,8 @@ it, it is best omitted from the debug output.

## `--resolver` option

Pass the option `--resolver <snapshot>` to specify the snapshot. For further
information, see the
[YAML configuration](yaml_configuration.md#snapshot) documentation.

At the command line (only):

* `--resolver lts-<major_version>` specifies the latest Stackage LTS Haskell
snapshot with the specified major version;
* `--resolver lts` specifies, from those with the greatest major version, the
latest Stackage LTS Haskell snapshot; and
* `--resolver nightly` specifies the most recent Stackage Nightly snapshot.
A synonym for the [`--snapshot` option](#snapshot-option) to specify the
snapshot resolver.

## `--[no-]rsl-in-log` flag

Expand Down Expand Up @@ -223,6 +214,22 @@ Enables/disables the skipping of installing MSYS2. For further information, see
the documentation for the corresponding non-project specific configuration
[option](yaml_configuration.md#skip-msys).

## `--snapshot` option

:octicons-tag-24: UNRELEASED

Pass the option `--snapshot <snapshot>` to specify the snapshot. For further
information, see the [YAML configuration](yaml_configuration.md#snapshot)
documentation.

At the command line (only):

* `--snapshot lts-<major_version>` specifies the latest Stackage LTS Haskell
snapshot with the specified major version;
* `--snapshot lts` specifies, from those with the greatest major version, the
latest Stackage LTS Haskell snapshot; and
* `--snapshot nightly` specifies the most recent Stackage Nightly snapshot.

## `--stack-colors` or `--stack-colours` options

Pass the option `--stack-colors <styles>` to specify Stack's output styles. For
Expand Down
4 changes: 3 additions & 1 deletion doc/yaml_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ snapshot.

### snapshot

Command line equivalent (takes precedence): `--resolver` option
Command line equivalent (takes precedence):
[`--snapshot`](global_flags.md#snapshot-option) or
[`--resolver`](global_flags.md#resolver-option) option

The `snapshot` key specifies which snapshot is to be used for this project. A
snapshot defines a GHC version, a number of packages available for installation,
Expand Down
9 changes: 5 additions & 4 deletions src/Stack/Options/ResolverParser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ import Stack.Options.Utils ( hideMods )
import Stack.Prelude
import Stack.Types.Resolver ( AbstractResolver, readAbstractResolver )

-- | Parser for the resolver
-- | Parser for the snapshot
abstractResolverOptsParser :: Bool -> Parser (Unresolved AbstractResolver)
abstractResolverOptsParser hide = option readAbstractResolver
( long "resolver"
<> metavar "RESOLVER"
<> help "Override resolver in project file."
( long "snapshot"
<> long "resolver"
<> metavar "SNAPSHOT"
<> help "Override snapshot in the project configuration file."
<> hideMods hide
)

Expand Down

0 comments on commit 25a7a2a

Please sign in to comment.