MCPcopy
hub / github.com/cheat/cheat / Paths

Function Paths

internal/completions/paths.go:8–25  ·  view source on GitHub ↗

Paths provides completion for the --path flag.

(
	_ *cobra.Command,
	_ []string,
	_ string,
)

Source from the content-addressed store, hash-verified

6
7// Paths provides completion for the --path flag.
8func Paths(
9 _ *cobra.Command,
10 _ []string,
11 _ string,
12) ([]string, cobra.ShellCompDirective) {
13
14 conf, err := loadConfig()
15 if err != nil {
16 return nil, cobra.ShellCompDirectiveNoFileComp
17 }
18
19 names := make([]string, 0, len(conf.Cheatpaths))
20 for _, cp := range conf.Cheatpaths {
21 names = append(names, cp.Name)
22 }
23
24 return names, cobra.ShellCompDirectiveNoFileComp
25}

Callers

nothing calls this directly

Calls 1

loadConfigFunction · 0.85

Tested by

no test coverage detected