MCPcopy Create free account
hub / github.com/UiPath/uipathcli / searchFlags

Method searchFlags

commandline/autocomplete_handler.go:184–197  ·  view source on GitHub ↗
(word string, command *CommandDefinition, exclude []string)

Source from the content-addressed store, hash-verified

182}
183
184func (a autoCompleteHandler) searchFlags(word string, command *CommandDefinition, exclude []string) []string {
185 result := []string{}
186 for _, flag := range command.Flags {
187 if strings.HasPrefix(flag.Name, word) {
188 result = append(result, "--"+flag.Name)
189 }
190 }
191 for _, flag := range command.Flags {
192 if strings.Contains(flag.Name, word) {
193 result = append(result, "--"+flag.Name)
194 }
195 }
196 return a.removeDuplicates(a.removeExcluded(result, exclude))
197}
198
199func (a autoCompleteHandler) removeDuplicates(values []string) []string {
200 keys := make(map[string]bool)

Callers 1

FindMethod · 0.95

Calls 2

removeDuplicatesMethod · 0.95
removeExcludedMethod · 0.95

Tested by

no test coverage detected