MCPcopy Create free account
hub / github.com/larksuite/cli / isCompletionCommand

Function isCompletionCommand

cmd/root.go:215–222  ·  view source on GitHub ↗

isCompletionCommand returns true if args indicate a shell completion request. Update notifications and Shutdown lifecycle emits must be suppressed for these to avoid corrupting machine-parseable completion output and to avoid firing plugin Shutdown handlers on every Tab keystroke. Cobra dispatches

(args []string)

Source from the content-addressed store, hash-verified

213// ShellCompNoDescRequestCmd). Check both, otherwise bash/zsh completion
214// (which often uses NoDesc) silently bypasses the gate.
215func isCompletionCommand(args []string) bool {
216 for _, arg := range args {
217 if arg == "completion" || arg == "__complete" || arg == "__completeNoDesc" {
218 return true
219 }
220 }
221 return false
222}
223
224// configureFlagCompletions enables cmdutil.RegisterFlagCompletion only when
225// the invocation will actually serve a __complete request.

Callers 3

ExecuteFunction · 0.85
configureFlagCompletionsFunction · 0.85
TestIsCompletionCommandFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestIsCompletionCommandFunction · 0.68