Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Make list-* commands consistent #6285
Conversation
natefinch
changed the title from
Make list-* commands consistent This change ensures that all list-* commands show the same style response when there are no values to display. It is a simple print to stderr that says 'No foos to display.' This fixes https://bugs.launchpad.net/juju/+bug/1596687
to
Make list-* commands consistent
Sep 20, 2016
| @@ -137,6 +137,11 @@ func (c *ListPlansCommand) Run(ctx *cmd.Context) (rErr error) { | ||
| } | ||
| output[i] = outputPlan | ||
| } | ||
| + | ||
| + if len(output) == 0 && c.out.Name() == "tabular" { |
natefinch
Sep 20, 2016
Contributor
Note that I have to do this ugly "if format == tabular" stuff because the formatting framework doesn't give the formatting function access to stderr, which is where we should be writing this output... so I have to do this hack here.
|
I'm reviewing this in ReviewBoard until we officially make a decision: http://reviews.vapour.ws/r/5726 |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
natefinch commentedSep 20, 2016
•
Edited 1 time
-
natefinch
Sep 20, 2016
This change ensures that all list-* commands show the same style response when there are no values to display. It is a simple print to stderr that says 'No foos to display.' This fixes https://bugs.launchpad.net/juju/+bug/1596687