~juju-qa/ubuntu/xenial/juju/2.0-rc2

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/cmd/juju/action/list.go

  • Committer: Nicholas Skaggs
  • Date: 2016-09-30 14:39:30 UTC
  • mfrom: (1.8.1)
  • Revision ID: nicholas.skaggs@canonical.com-20160930143930-vwwhrefh6ftckccy
import upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
        case "yaml", "json":
119
119
                output = shortOutput
120
120
        default:
 
121
                if len(sortedNames) == 0 {
 
122
                        ctx.Infof("No actions defined for %s.", c.applicationTag.Id())
 
123
                        return nil
 
124
                }
121
125
                var list []listOutput
122
126
                for _, name := range sortedNames {
123
127
                        list = append(list, listOutput{name, shortOutput[name]})
140
144
                return errors.New("unexpected value")
141
145
        }
142
146
 
143
 
        if len(list) == 0 {
144
 
                fmt.Fprintf(writer, "No actions defined for %s", c.applicationTag.Id())
145
 
                return nil
146
 
        }
147
 
 
148
147
        tw := output.TabWriter(writer)
149
148
        fmt.Fprintf(tw, "%s\t%s\n", "ACTION", "DESCRIPTION")
150
149
        for _, value := range list {