MCPcopy Create free account
hub / github.com/algolia/cli / commandType

Function commandType

internal/docs/docs.go:96–110  ·  view source on GitHub ↗
(cmd *cobra.Command)

Source from the content-addressed store, hash-verified

94}
95
96func commandType(cmd *cobra.Command) string {
97 switch cmd.Name() {
98 case "tail":
99 return "stream"
100 case "search", "browse", "get", "list", "stats", "analyze", "describe", "schema", "open":
101 return "read"
102 case "create", "delete", "clear", "import", "update", "set", "save", "move", "copy", "crawl", "run", "pause", "reindex", "unblock", "remove", "add", "setdefault":
103 return "write"
104 default:
105 if cmd.HasAvailableSubCommands() {
106 return "namespace"
107 }
108 return "other"
109 }
110}
111
112func getCommands(cmd *cobra.Command) []Command {
113 var commands []Command

Callers 1

newCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected