The current [bash_completions.md]
(https://github.com/spf13/cobra/blob/master/bash_completions.md)
And it might be best to scale back the initial statement "is incredibly easy", since I'm a seasoned developer and can make no sense of the example at all, as it uses custom kube stuff that has moved around and doesn't seem relevant.
A basic example on a simpler go repo would work a lot better.
Thanks!
Of course this is really easy. In our situation, we have a command RootCmd which has all the other commands added to it. Seems like an easy example like this could just be included. Works perfectly, thanks.
func main() {
err := cmd.RootCmd.GenBashCompletionFile("bin/ddev_completion.sh")
util.CheckErr(err)
}
/cc @eparis
@rfay Ha. Hard to argue. I wrote the bash completions stuff so I could use it in kube. At the time it seemed so 'simple'. I'd love a PR that makes an actually simple example.
it may be simple, but it is not self-explanatory. would be helpful to have an explanation of how to generalize it to my own command.
It would be great if someone could provide an auto-completion example for a custom command :)
+1 would love to see a generic example
This issue is being marked as stale due to a long period of inactivity