loadFile takes a yaml file at the given path, parses it and returns a pluginCommand object
(path string)
| 319 | |
| 320 | // loadFile takes a yaml file at the given path, parses it and returns a pluginCommand object |
| 321 | func loadFile(path string) (*pluginCommand, error) { |
| 322 | cmds := new(pluginCommand) |
| 323 | b, err := os.ReadFile(path) |
| 324 | if err != nil { |
| 325 | return cmds, fmt.Errorf("file (%s) not provided by plugin. No plugin auto-completion possible", path) |
| 326 | } |
| 327 | |
| 328 | err = yaml.Unmarshal(b, cmds) |
| 329 | return cmds, err |
| 330 | } |
| 331 | |
| 332 | // pluginDynamicComp call the plugin.complete script of the plugin (if available) |
| 333 | // to obtain the dynamic completion choices. It must pass all the flags and sub-commands |
no outgoing calls
no test coverage detected
searching dependent graphs…