Skip to content

Commit 192508d

Browse files
committed
lib search with no result is not an error
1 parent 5d52b3f commit 192508d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

commands/lib/search.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,19 @@ func runSearchCommand(cmd *cobra.Command, args []string) {
7474
os.Exit(commands.ErrCoreConfig)
7575
}
7676

77-
message := output.LibSearchResults{
77+
res := output.LibSearchResults{
7878
Libraries: []*libraries.Library{},
7979
}
8080
for _, lib := range status.Libraries {
8181
if strings.Contains(strings.ToLower(lib.Name), query) {
82-
message.Libraries = append(message.Libraries, lib)
82+
res.Libraries = append(res.Libraries, lib)
8383
}
8484
}
8585

86-
if len(message.Libraries) == 0 {
87-
formatter.PrintErrorMessage(fmt.Sprintf("No library found matching `%s` search query", query))
86+
if len(res.Libraries) == 0 {
87+
formatter.Print(fmt.Sprintf("No library found matching `%s` search query", query))
8888
} else {
89-
formatter.Print(message)
89+
formatter.Print(res)
9090
}
9191
logrus.Info("Done")
9292
}

0 commit comments

Comments
 (0)