MCPcopy Create free account
hub / github.com/cli/cli / RegisterEventTypesCompletion

Function RegisterEventTypesCompletion

pkg/cmd/event/shared/completion.go:12–16  ·  view source on GitHub ↗

RegisterEventTypesCompletion suggests the known event types for a comma-separated flag. The flag still accepts any value, because the server may support event types that this build does not know about.

(cmd *cobra.Command, flag string)

Source from the content-addressed store, hash-verified

10// RegisterEventTypesCompletion suggests the known event types for a comma-separated flag. The flag still accepts
11// any value, because the server may support event types that this build does not know about.
12func RegisterEventTypesCompletion(cmd *cobra.Command, flag string) {
13 _ = cmd.RegisterFlagCompletionFunc(flag, func(_ *cobra.Command, _ []string, toComplete string) ([]string, cobra.ShellCompDirective) {
14 return CompleteEventTypes(toComplete), cobra.ShellCompDirectiveNoSpace | cobra.ShellCompDirectiveNoFileComp
15 })
16}
17
18// CompleteEventTypes returns the known event types that complete the last comma-separated item of toComplete, each
19// prefixed with the preceding items and followed by its description. Types already listed are left out.

Callers 2

NewCmdCreateFunction · 0.92
NewCmdListenFunction · 0.92

Calls 1

CompleteEventTypesFunction · 0.85

Tested by

no test coverage detected