Skip to content
Snippets Groups Projects
Unverified Commit 21fa4480 authored by dlorenc's avatar dlorenc Committed by GitHub
Browse files

Cleanup the output of search (the text goes to stderr not stdout). (#421)


Fixes #420.

Signed-off-by: default avatarDan Lorenc <dlorenc@google.com>
parent 775f38b4
No related branches found
No related tags found
No related merge requests found
......@@ -44,14 +44,7 @@ type searchCmdOutput struct {
}
func (s *searchCmdOutput) String() string {
str := "No matching entries were found\n"
for i, uuid := range s.uuids {
if i == 0 {
str = "Found matching entries (listed by UUID):\n"
}
str += fmt.Sprintf("%v\n", uuid)
}
return str
return strings.Join(s.uuids, "\n") + "\n" // one extra /n to terminate the list
}
func addSearchPFlags(cmd *cobra.Command) error {
......@@ -203,6 +196,8 @@ var searchCmd = &cobra.Command{
return nil, fmt.Errorf("no matching entries found")
}
fmt.Fprintln(os.Stderr, "Found matching entries (listed by UUID):")
return &searchCmdOutput{
uuids: resp.GetPayload(),
}, nil
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment