cli
cli copied to clipboard
Update message is printed to stdout instead of stderr
Version
Fastly CLI version v4.1.0 (b4884e4) Built with go version go1.18.6 linux/amd64 Viceroy version: viceroy 0.2.15
What happened
When a newer version of the fastly cli is available, the cli prints an update message to stdout, which can cause issues for scripts that were expecting stdout to contain only the expected output of the command that was run.
E.G. fastly profile token
will usually just print the token, but when a newer cli version if available, it will also print the update message to stdout.
Could we update the fastly cli to print the update message to stderr instead of stdout? https://github.com/fastly/cli/blob/e6d4c7946af24d0ec3f87d808c7ac39f64e32e4e/pkg/app/run.go#L189
My only concern with printing to os.Stderr is that this message isn't an error and is genuinely intended for stdout.
So I'm thinking instead this output should be wrapped in a condition such that it only prints if --verbose
is set.
The downside of that is that people almost never use --verbose
, but the alternative isn't as nice and would mean adding a --quiet
flag instead so a user would have to explicitly opt into using it for a command like profile token
.
I'm all for a --quiet
flag 👍