|
|
@ -86,12 +86,11 @@ func newListCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
|
|
|
|
|
|
|
|
|
|
|
|
names := make([]string, 0)
|
|
|
|
names := make([]string, 0)
|
|
|
|
for _, res := range results {
|
|
|
|
for _, res := range results {
|
|
|
|
//fmt.Fprintln(out, res.Name)
|
|
|
|
|
|
|
|
names = append(names, res.Name)
|
|
|
|
names = append(names, res.Name)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
outputFlag := cmd.Flag("output")
|
|
|
|
outputFlag := cmd.Flag("output")
|
|
|
|
if outputFlag.Changed {
|
|
|
|
|
|
|
|
switch outputFlag.Value.String() {
|
|
|
|
switch outputFlag.Value.String() {
|
|
|
|
case "json":
|
|
|
|
case "json":
|
|
|
|
output.EncodeJSON(out, names)
|
|
|
|
output.EncodeJSON(out, names)
|
|
|
@ -99,15 +98,14 @@ func newListCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
|
|
|
|
case "yaml":
|
|
|
|
case "yaml":
|
|
|
|
output.EncodeYAML(out, names)
|
|
|
|
output.EncodeYAML(out, names)
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|
default:
|
|
|
|
case "table":
|
|
|
|
return outfmt.Write(out, newReleaseListWriter(results))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for _, res := range results {
|
|
|
|
for _, res := range results {
|
|
|
|
fmt.Fprintln(out, res.Name)
|
|
|
|
fmt.Fprintln(out, res.Name)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
return outfmt.Write(out, newReleaseListWriter(results))
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return outfmt.Write(out, newReleaseListWriter(results))
|
|
|
|
return outfmt.Write(out, newReleaseListWriter(results))
|
|
|
|