(osArgs []string)
| 28 | } |
| 29 | |
| 30 | func IsPluginCommand(osArgs []string) (configv3.Plugin, bool) { |
| 31 | if len(osArgs) < 1 { |
| 32 | return configv3.Plugin{}, false |
| 33 | } |
| 34 | command := osArgs[0] |
| 35 | config, configErr := configv3.LoadConfig() |
| 36 | if configErr != nil { |
| 37 | fmt.Fprintf(os.Stderr, "Empty Config, failed to load plugins") |
| 38 | return configv3.Plugin{}, false |
| 39 | } |
| 40 | for _, plugin := range config.Plugins() { |
| 41 | for _, pluginCommand := range plugin.Commands { |
| 42 | if command == pluginCommand.Name || command == pluginCommand.Alias { |
| 43 | return plugin, true |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 | return configv3.Plugin{}, false |
| 48 | } |
| 49 | |
| 50 | func PluginCommandNames() []string { |
| 51 | var names []string |
nothing calls this directly
no test coverage detected