Skip to content

Commit 7956279

Browse files
committed
Re #6250 Output to standard output, not standard error
Also uses terms standard output stream and standard error stream consistently in documentation.
1 parent 93da0ca commit 7956279

14 files changed

+95
-80
lines changed

ChangeLog.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Major changes:
1010

1111
Behavior changes:
1212

13-
* `stack list` outputs to standard output rather than to standard error.
13+
* `stack list`, `stack templates` and `stack uninstall` output to the standard
14+
output stream rather than to the standard error stream.
1415

1516
Other enhancements:
1617

@@ -185,7 +186,7 @@ Behavior changes:
185186
[Haskell Error Index](https://errors.haskell.org/) initiative, all Stack
186187
error messages generated by Stack itself begin with an unique code in the
187188
form `[S-nnnn]`, where `nnnn` is a four-digit number.
188-
* Test suite executables that seek input on the standard input channel (`stdin`)
189+
* Test suite executables that seek input on the standard input stream (`stdin`)
189190
will not throw an exception. Previously, they would thow an exception,
190191
consistent with Cabal's 'exitcode-stdio-1.0' test suite interface
191192
specification. Pass the flag `--no-tests-allow-stdin` to `stack build` to

doc/build_command.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -555,14 +555,14 @@ package is targetted in a multi-package project (for example, using
555555
`stack build <package_name>`).
556556

557557
* **One target package:** The build output for the target package is sent to the
558-
standard error output stream of the console as it happens.
558+
standard error stream of the console as it happens.
559559

560560
* **More than one target package:** The build output from GHC (as opposed to
561561
from Stack) for each target package is sent to a log file for that package,
562562
unless an error occurs that prevents that. At the end of the build, the
563563
location of the directory containing the log files is reported. To also output
564-
the contents of the log files to the standard error output stream of the
565-
console at the end of the build, use Stack's `dump-logs` option. For further
564+
the contents of the log files to the standard error stream of the console at
565+
the end of the build, use Stack's `dump-logs` option. For further
566566
information about that option, see the
567567
[YAML configuration](yaml_configuration.md#dump-logs) documentation. The
568568
default `dump-logs` mode is to output the contents of the log files that are
@@ -606,10 +606,10 @@ Default: Enabled
606606
Cabal defines a test suite interface
607607
['exitcode-stdio-1.0'](https://hackage.haskell.org/package/Cabal-syntax-3.8.1.0/docs/Distribution-Types-TestSuiteInterface.html#v:TestSuiteExeV1.0)
608608
where the test suite takes the form of an executable and the executable takes
609-
nothing on the standard input channel (`stdin`). Pass this flag to override that
610-
specification and allow the executable to receive input on that channel. If you
609+
nothing on the standard input stream (`stdin`). Pass this flag to override that
610+
specification and allow the executable to receive input on that stream. If you
611611
pass `--no-tests-allow-stdin` and the executable seeks input on the standard
612-
input channel, an exception will be thown.
612+
input stream, an exception will be thown.
613613

614614
## Examples
615615

doc/dot_command.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ graphs and the `dot` executable for drawing directed graphs. Graphviz is
1515
available to [download](https://www.graphviz.org/download/) for Linux, Windows,
1616
macOS and FreeBSD.
1717

18-
`stack dot` produces output, to the standard output channel, in the DOT language
18+
`stack dot` produces output, to the standard output stream, in the DOT language
1919
to represent the relationships between your packages and their dependencies.
2020

2121
By default:

doc/global_flags.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ specific configuration [option](yaml_configuration.md#ghc-variant).
8787
## `--hpack-numeric-version` flag
8888

8989
Pass the flag `--hpack-numeric-version` to cause Stack to report the numeric
90-
version of its built-in Hpack library to standard output (e.g. `0.35.0`) and
91-
quit.
90+
version of its built-in Hpack library to the standard output stream (e.g.
91+
`0.35.0`) and quit.
9292

9393
## `--[no-]install-ghc` flag
9494

@@ -158,7 +158,7 @@ Stack can be configured to integrate with Nix. For further information, see
158158
## `--numeric-version` flag
159159

160160
Pass the flag `--numeric-version` to cause Stack to report its numeric version
161-
to standard output (e.g. `2.9.1`) and quit.
161+
to the standard output stream (e.g. `2.9.1`) and quit.
162162

163163
## `--[no-]plan-in-log` flag
164164

doc/ide_command.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ stack ide packages [--stdout] [--cabal-files]
2424

2525
By default:
2626

27-
* its output is sent to the standard error channel. Pass the flag `--stdout` to
28-
change to the standard output channel; and
27+
* its output is sent to the standard error stream. Pass the flag `--stdout` to
28+
change to the standard output stream; and
2929
* the output is the package name (without its version). Pass the flag
3030
`--cabal-files` to change to the full path to the package's Cabal file.
3131

@@ -39,8 +39,8 @@ stack ide targets [--exes] [--tests] [--benchmarks] [--stdout]
3939
or more of the flags `--exes`, `--tests` and `--benchmarks` to list only targets
4040
of those component types.
4141

42-
By default, its output is sent to the standard error channel. Pass the flag
43-
`--stdout` to change to the standard output channel.
42+
By default, its output is sent to the standard error stream. Pass the flag
43+
`--stdout` to change to the standard output stream.
4444

4545
For example, for the Stack project itself, command:
4646

doc/list_command.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,22 @@
88
stack list [PACKAGE]
99
~~~
1010

11-
`stack list <package_name>` will list the latest version of the package from
12-
Hackage. If the package name cannot be found on Hackage, even after updating the
13-
package index, suggestions (not necessarily good ones) will be made about the
14-
intended package name.
11+
`stack list <package_name>` will send to the standard output stream the latest
12+
version of the package from Hackage. If the package name cannot be found on
13+
Hackage, even after updating the package index, suggestions (not necessarily
14+
good ones) will be made about the intended package name.
1515

16-
`stack --resolver <snapshot> list <package_name>` will list the version of the
17-
package in the specified snapshot, unless the package comes with GHC on
18-
Unix-like operating systems. If the package name cannot be found in the
19-
snapshot, the command will fail, identifying only the package(s) that did not
20-
appear in the snapshot.
16+
`stack --resolver <snapshot> list <package_name>` will send to the standard
17+
output stream the version of the package in the specified snapshot, unless the
18+
package comes with GHC on Unix-like operating systems. If the package name
19+
cannot be found in the snapshot, the command will fail, identifying only the
20+
package(s) that did not appear in the snapshot.
2121

2222
More than one package name can be specified.
2323

24-
`stack --resolver <snapshot> list` will list all the packages in the specified
25-
snapshot, except those which come with GHC on Unix-like operating systems.
24+
`stack --resolver <snapshot> list` will send to the standard output stream a
25+
list of all the packages in the specified snapshot, except those which come with
26+
GHC on Unix-like operating systems.
2627

2728
For example:
2829

doc/templates_command.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
stack templates
77
~~~
88

9-
`stack templates` provides information about project templates used with the
10-
[`stack new` command](new_command.md).
9+
`stack templates` provides information to the standard output stream about
10+
project templates used with the [`stack new` command](new_command.md).
1111

1212
Project templates are specified in `.hsfiles` files. The format of those files
1313
is documented at the

doc/uninstall_command.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
stack uninstall
77
~~~
88

9-
`stack uninstall` provides information about how to uninstall Stack or a
10-
Stack-supplied tool (such as GHC or, on Windows, MSYS2). It does not
11-
itself uninstall Stack or a Stack-supplied tool.
9+
`stack uninstall` provides information to the standard output stream about how
10+
to uninstall Stack or a Stack-supplied tool (such as GHC or, on Windows, MSYS2).
11+
It does not itself uninstall Stack or a Stack-supplied tool.

doc/yaml_configuration.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -796,8 +796,8 @@ unless an error occurs that prevents that. For further information, see the
796796
documentation.
797797

798798
The value of the `dump-logs` key controls what, if any, log file content is sent
799-
('dumped') to the standard error output stream of the console at the end of the
800-
build. Possible values are:
799+
('dumped') to the standard error stream of the console at the end of the build.
800+
Possible values are:
801801

802802
~~~yaml
803803
dump-logs: none # don't dump the content of any log files
@@ -810,8 +810,8 @@ At the command line, `--no-dump-logs` is equivalent to `dump-logs: none` and
810810

811811
If GHC reports an error during the build and a log file is created, that build
812812
output will be included in the log file. Stack will also report errors during
813-
building to the standard error output stream. That stream can be piped to a
814-
file. For example, for a file named `stderr.log`:
813+
building to the standard error stream. That stream can be piped to a file. For
814+
example, for a file named `stderr.log`:
815815

816816
~~~text
817817
stack --no-dump-logs --color always build --no-interleaved-output 2> stderr.log

src/Stack/ConfigCmd.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,4 +364,4 @@ cfgCmdEnv es = do
364364
encodeUtf8Builder key <> ";\n"
365365
escape '\'' = "'\"'\"'"
366366
escape c = T.singleton c
367-
hPutBuilder stdout $ Map.foldMapWithKey toLine actions
367+
putBuilder $ Map.foldMapWithKey toLine actions

0 commit comments

Comments
 (0)