MCPcopy Create free account
hub / github.com/celer-pkg/celer / completion

Method completion

cmds/cmd_init.go:78–89  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string, toComplete string)

Source from the content-addressed store, hash-verified

76}
77
78func (i *initCmd) completion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
79 var suggestions []string
80
81 // Provide flag completion
82 for _, flag := range []string{"--url", "-u", "--branch", "-b", "--force", "-f"} {
83 if strings.HasPrefix(flag, toComplete) {
84 suggestions = append(suggestions, flag)
85 }
86 }
87
88 return suggestions, cobra.ShellCompDirectiveNoFileComp
89}

Callers 1

TestInitCmd_CompletionFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestInitCmd_CompletionFunction · 0.76