Skip to content

Commit 1da56ec

Browse files
committed
Fix #6773 Add -w as synonym for --stack-yaml
1 parent 1b1dba9 commit 1da56ec

File tree

7 files changed

+12
-10
lines changed

7 files changed

+12
-10
lines changed

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Other enhancements:
2525
* From GHC 9.12.1, `base` is not a GHC wired-in package. In configuration files,
2626
the `notify-if-base-not-boot` key is introduced, to allow the exisitng
2727
notification to be muted if unwanted when using such GHC versions.
28+
* Add option `-w` as synonym for `--stack-yaml`.
2829

2930
Bug fixes:
3031

doc/build_overview.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ Given these inputs, Stack attempts the following process when performing a build
5252

5353
## Find the `stack.yaml` file
5454

55-
* Check for a `--stack-yaml` CLI arg, and use that
56-
* Check for a `STACK_YAML` env var
55+
* Check for a `--stack-yaml` or `-w` command line argument, and use that
56+
* Check for a `STACK_YAML` environment variable
5757
* Look for a `stack.yaml` in this directory or ancestor directories
5858
* Fall back to the default global project
5959

@@ -199,7 +199,7 @@ they get prepended otherwise they get used as is.
199199
Use some deterministic binary serialization and SHA256 thereof to get
200200
a hash of the following information:
201201

202-
* Actual compiler (GHC version, path, *FIXME* probably some other unique info
202+
* Actual compiler (GHC version, path, *FIXME* probably some other unique info
203203
from GHC, I have heard that `ghc --info` gives you something)
204204
* Global database map
205205
* Immutable dependency map
@@ -233,7 +233,7 @@ installed in this database will never need to be rebuilt.
233233
all enabled components (using the fun backwards compat logic for
234234
`build-tools`)
235235
* Apply the logic recursively to come up with a full build plan
236-
* If a task depends exclusively on immutable packages, mark it as immutable.
236+
* If a task depends exclusively on immutable packages, mark it as immutable.
237237
Otherwise, it is mutable. The former go into the snapshot database, the latter
238238
into the local database.
239239

doc/configure/environment_variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ Related command: all commands that make use of Stack's
167167
[project-level configuration](yaml/index.md).
168168

169169
Overridden by: Stack's global
170-
[`--stack-yaml`](global_flags.md#-stack-yaml-option) option.
170+
[`--stack-yaml`](global_flags.md#-stack-yaml-or-w-option) option.
171171

172172
The environment variable `STACK_YAML` can be used to specify Stack's
173173
project-level configuration file.

doc/configure/global_flags.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ Pass the option `--stack-root <absolute_path_to_the_Stack_root>` to specify the
324324
path to the [Stack root](../topics/stack_root.md) directory. The path must be an
325325
absolute one.
326326

327-
## `--stack-yaml` option
327+
## `--stack-yaml` or `-w` option
328328

329329
Default: `stack.yaml`
330330

doc/configure/yaml/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Stack's configuration files are each of one of two types:
7373
Stack obtains project-level configuration from one of the following (in order of
7474
preference):
7575

76-
1. A file specified by the `--stack-yaml` command line option.
76+
1. A file specified by the `--stack-yaml` or `-w` command line option.
7777
2. A file specified by the `STACK_YAML` environment variable.
7878
3. A file named `stack.yaml` in the current directory or an ancestor directory.
7979
4. A file name `stack.yaml` in the `global-project` directory in the

doc/tutorial/stack_configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Whenever you run something with Stack, it needs a project-level configuration
66
file. The algorithm Stack uses to find such a file is:
77

8-
1. Check for a `--stack-yaml` option on the command line
8+
1. Check for a `--stack-yaml` or `-w` option on the command line
99
2. Check for a `STACK_YAML` environment variable
1010
3. Check the current directory and all ancestor directories for a `stack.yaml`
1111
file
@@ -30,7 +30,7 @@ for you with the latest LTS snapshot. This allows you to do things like:
3030
Keep in mind that there is nothing magical about this implicit global
3131
configuration. It has no effect on projects at all. Every package you install
3232
with it is put into isolated databases just like everywhere else. The only magic
33-
is that it is the catch-all project whenever you are running Stack somewhere
33+
is that it is the catch-all project whenever you are running Stack somewhere
3434
else.
3535

3636
## Package description vs project-level configuration

src/Stack/Options/GlobalParser.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module Stack.Options.GlobalParser
1717

1818
import Options.Applicative
1919
( Mod, Parser, ReadM, auto, completer, help, hidden, internal
20-
, long, metavar, option, strOption, value
20+
, long, metavar, option, short, strOption, value
2121
)
2222
import Options.Applicative.Builder.Extra
2323
( fileExtCompleter, firstBoolFlagsFalse
@@ -102,6 +102,7 @@ globalOptsParser currentDir kind = GlobalOptsMonoid
102102
))
103103
<*> optionalFirst (strOption
104104
( long "stack-yaml"
105+
<> short 'w'
105106
<> metavar "STACK-YAML"
106107
<> completer (fileExtCompleter [".yaml"])
107108
<> help "Override project stack.yaml file (overrides any STACK_YAML \

0 commit comments

Comments
 (0)