Skip to content

Commit

Permalink
krew search: doesn't output header when no plugins found (kubernetes-…
Browse files Browse the repository at this point in the history
…sigs#15)

This PR improves krew search not to output header when no plugins found.

/fix kubernetes-sigs#13
  • Loading branch information
superbrothers authored and lbb committed Jul 28, 2018
1 parent 08412be commit 5d915a0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/krew/cmd/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ Search accepts a list of words as options.`,
matchNames = names
}

// No plugins found
if len(matchNames) == 0 {
return nil
}

rowPattern := "%s\t%s\t%s\n"
w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0)
fmt.Fprintf(w, rowPattern, "NAME", "DESCRIPTION", "STATUS")
Expand Down

0 comments on commit 5d915a0

Please sign in to comment.