Paths provides completion for the --path flag.
( _ *cobra.Command, _ []string, _ string, )
| 6 | |
| 7 | // Paths provides completion for the --path flag. |
| 8 | func 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 | } |
nothing calls this directly
no test coverage detected