Skip to content

Commit

Permalink
Use default completion command provided by cobra. (#522)
Browse files Browse the repository at this point in the history
* Use default `completion` command provided by cobra.

`cobra` provides default `completion` subcommand.
It supports bash, zsh, fish, and powershell by default.

* update docs
  • Loading branch information
darklore authored Dec 5, 2021
1 parent 5640c33 commit 6ff3469
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 68 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,11 +480,11 @@ eStargz-optimized images.

## Does `ko` support autocompletion?

Yes! `ko completion` generates a Bash completion script, which you can add to
your `bash_completion` directory:
Yes! `ko completion` generates a Bash/Zsh/Fish/PowerShell completion script.
You can get how to load it from help document.

```
ko completion > /usr/local/etc/bash_completion.d/ko
ko completion [bash|zsh|fish|powershell] --help
```

Or, you can source it directly:
Expand Down
1 change: 0 additions & 1 deletion doc/ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ ko [flags]

* [ko apply](ko_apply.md) - Apply the input files with image references resolved to built/pushed image digests.
* [ko build](ko_build.md) - Build and publish container images from the given importpaths.
* [ko completion](ko_completion.md) - Output shell completion code (default Bash)
* [ko create](ko_create.md) - Create the input files with image references resolved to built/pushed image digests.
* [ko delete](ko_delete.md) - See "kubectl help delete" for detailed usage.
* [ko deps](ko_deps.md) - Print Go module dependency information about the ko-built binary in the image
Expand Down
19 changes: 0 additions & 19 deletions doc/ko_completion.md

This file was deleted.

1 change: 0 additions & 1 deletion pkg/commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ func AddKubeCommands(topLevel *cobra.Command) {
addBuild(topLevel)
addRun(topLevel)
addDeps(topLevel)
addCompletion(topLevel)
}

// check if kubectl is installed
Expand Down
44 changes: 0 additions & 44 deletions pkg/commands/completion.go

This file was deleted.

0 comments on commit 6ff3469

Please sign in to comment.