deis / workflow-cli

The CLI for Deis Workflow
http://deis.com
MIT License
31 stars 43 forks source link

Add a quiet flag to remove superfluous output #237

Open tantalic opened 7 years ago

tantalic commented 7 years ago

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.

tantalic commented 7 years ago

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.

Joshua-Anderson commented 7 years ago

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.

Joshua-Anderson commented 7 years ago

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.

tantalic commented 7 years ago

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 6 years ago

This issue was moved to teamhephy/workflow-cli#19