|
|
@ -16,9 +16,9 @@ func init() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var searchCmd = &cobra.Command{
|
|
|
|
var searchCmd = &cobra.Command{
|
|
|
|
Use: "search [CHART]",
|
|
|
|
Use: "search [keyword]",
|
|
|
|
Short: "Search for charts",
|
|
|
|
Short: "Search for a keyword in charts",
|
|
|
|
Long: "", //TODO: add search command description
|
|
|
|
Long: "Searches the known repositories cache files for the specified search string, looks at name and keywords",
|
|
|
|
RunE: search,
|
|
|
|
RunE: search,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -31,10 +31,14 @@ func search(cmd *cobra.Command, args []string) error {
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(results) > 0 {
|
|
|
|
cmd.Println("Charts:")
|
|
|
|
cmd.Println("Charts:")
|
|
|
|
for _, result := range results {
|
|
|
|
for _, result := range results {
|
|
|
|
fmt.Println(result)
|
|
|
|
fmt.Println(result)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return errors.New("No matches found")
|
|
|
|
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|