teamhephy / workflow-cli

MIT License
2 stars 13 forks source link

Add a quiet flag to remove superfluous output #19

Closed Cryptophobia closed 5 years ago

Cryptophobia commented 6 years ago

From @tantalic on September 13, 2016 0:1

Currently deis commands output a "header" as the first line of output, for example deis apps:list will output something like:

=== Apps
casual-quacking
hidden-mongoose
zephyr-instinct

In some situations command may also output some warning:

!    WARNING: Client and server API versions do not match. Please consider upgrading.
!    Client version: 2.3
!    Server version: 2.2
=== Apps
casual-quacking
hidden-mongoose
zephyr-instinct

It would make it easier to use the output of deis commands as input to other commands if a -q --quiet flag was available which removed the superfluous output.

Copied from original issue: deis/workflow-cli#237

Cryptophobia commented 6 years ago

From @tantalic on September 13, 2016 0:3

This came up as part of upgrading to Workflow v2.5 and needing to convert all my applications from replication controllers to deployments. I am sure there are other instances that I have not yet thought of where this would be useful. It would also make it easy to provide one-liners in documentation as part of upgrade processes in the future for such tasks.

Cryptophobia commented 6 years ago

From @Joshua-Anderson on September 13, 2016 0:20

Deis prints the warning message to stderr, so that can be masked be redirecting the output, as a workaround for now. I saw your -o issue as well, is there any preference in priority between the two? I'd personally think that json is probably better for machine parsing, so it might be more useful to tackle first. I can also see that quiet mode could be helpful for basic bash stuff though.

Cryptophobia commented 6 years ago

From @Joshua-Anderson on September 13, 2016 0:21

Also, deis don't really use return codes at all rigt now (I think everything returns 1) that needs to be fixed before error handling in quiet mode can really be useful.

Cryptophobia commented 6 years ago

From @tantalic on September 13, 2016 0:28

I have mixed feelings on prioritization of issues, because I think they have different but overlapping use cases. A -o option is best for machine parsing and more complex data-pipelining tasks while a -q option is better for quick/simple scripting. It is certainly possible to use tools such as jq for scripting tasks, but that isn't really in the "standard" unix toolbox for most users.

With all that said (and without knowing which seems easiest to implement) the -o option does give the most flexibility if users step out of the standard unix tools so it may make the most sense for prioritization.

Cryptophobia commented 5 years ago

Client and Server versions should match and the warning is necessary to inform the user. With version v2.20.0 we finally have a matching version of CLI to server. :+1:

Because of that, this issue can be closed for now until someone really really wants a quiet flag again. :wink: