cobra
cobra copied to clipboard
I want to achieve like `kubectl edit`,but there is no example surfing on internet,plz someone provide me some instructions!
input kubectl edit
and a vim-style screen appears,how can I do this using Cobra?there is no example on internet.and I tried govim,read kubectl opensource code,and it`s hard to write like it.
Seeing as kubectl is using Cobra, what is stopping you from checking out the kubectl source to the edit command? https://github.com/kubernetes/kubectl/blob/master/pkg/cmd/edit/edit.go
Seeing as kubectl is using Cobra, what is stopping you from checking out the kubectl source to the edit command? https://github.com/kubernetes/kubectl/blob/master/pkg/cmd/edit/edit.go
now I success,and kubectl source code makes it so complex to understand,I just read it and gave up.via chatgpt,I found a way much easier to understand