mirror of
https://github.com/spf13/cobra
synced 2024-11-24 14:47:12 +00:00
Update the bash completion example for kubectl (#645)
This commit is contained in:
parent
6644d46b81
commit
c6c44e6fdc
1 changed files with 6 additions and 5 deletions
|
@ -6,15 +6,16 @@ Generating bash completions from a cobra command is incredibly easy. An actual p
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd"
|
"k8s.io/kubernetes/pkg/kubectl/cmd"
|
||||||
|
"k8s.io/kubernetes/pkg/kubectl/cmd/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
kubectl := cmd.NewFactory(nil).NewKubectlCommand(os.Stdin, ioutil.Discard, ioutil.Discard)
|
kubectl := cmd.NewKubectlCommand(util.NewFactory(nil), os.Stdin, ioutil.Discard, ioutil.Discard)
|
||||||
kubectl.GenBashCompletionFile("out.sh")
|
kubectl.GenBashCompletionFile("out.sh")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue