forked from redhat-developer/odo
/
search.go
29 lines (24 loc) · 1021 Bytes
/
search.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package search
import (
"fmt"
"github.com/openshift/odo/pkg/odo/util"
"github.com/spf13/cobra"
)
// RecommendedCommandName is the recommended command name
const RecommendedCommandName = "search"
// NewCmdCatalogSearch implements the odo catalog search command
func NewCmdCatalogSearch(name, fullName string) *cobra.Command {
component := NewCmdCatalogSearchComponent(componentRecommendedCommandName, util.GetFullName(fullName, componentRecommendedCommandName))
service := NewCmdCatalogSearchService(serviceRecommendedCommandName, util.GetFullName(fullName, serviceRecommendedCommandName))
catalogSearchCmd := &cobra.Command{
Use: name,
Short: "Search available component & service types.",
Long: `Search available component & service types..
This searches for a partial match for the given search term in all the available
components & services.
`,
Example: fmt.Sprintf("%s\n\n%s\n", component.Example, service.Example),
}
catalogSearchCmd.AddCommand(component, service)
return catalogSearchCmd
}