Make list-* commands consistent #6285

Merged
merged 1 commit into from Sep 22, 2016

Conversation

Projects
None yet
3 participants
Contributor

natefinch commented 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

@natefinch 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

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.

Contributor

kat-co commented Sep 20, 2016

I'm reviewing this in ReviewBoard until we officially make a decision: http://reviews.vapour.ws/r/5726

Contributor

natefinch commented Sep 20, 2016

$$merge$$

Contributor

jujubot commented Sep 20, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Sep 20, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/9285

Contributor

natefinch commented Sep 22, 2016

$$merge$$

Contributor

jujubot commented Sep 22, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Sep 22, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/9307

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
Contributor

natefinch commented Sep 22, 2016

$$merge$$

Contributor

jujubot commented Sep 22, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit eb180d2 into juju:master Sep 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment