pulumi/pkg/cmd
Abhinav Gupta 661f98d18d
cmd/stack output: Introduce a Writer abstraction
There's a bit of branching and duplication
between the JSON and the default case.

    (with --json + without) x (with an argument + without)

That branching will only get worse with the upcoming `--shell` flag
(#2632).

This change defines an stackOutputWriter interface
that handles the actual printing,
with two implementations: one for JSON, one for user-readable output.

Note that all writers currently write directly to stdout.
In a future change, these may begin using `io.Writer`s.

In service to #2632
2023-01-25 12:03:43 -08:00
..
pulumi cmd/stack output: Introduce a Writer abstraction 2023-01-25 12:03:43 -08:00