openshift / openshift/source-to-image
Custom shell completions overrides default cobra completions
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 2.5k
- Forks
- 701
- PR merge metrics
- No merged PRs in 30d
Description
We found out in https://src.fedoraproject.org/rpms/source-to-image/pull-request/9 that source-to-image has custom code in https://github.com/openshift/source-to-image/blob/master/pkg/cmd/cli/cmd/completion.go that overrides cobra's default completion subcommand. Maybe this was necessary with older versions of cobra, but now, overriding this removes the ability to generate completions for fish and powershell which cobra supports, and also the custom code does not use cobra's native support for zsh completions — it instead seems to borrow old code from kubectl. Can this custom completion command be removed?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with pkg/cmd/cli/cmd/completion.go and inspect how the custom completion subcommand replaces Cobra's native command. Remove the override if Cobra now provides the required behavior, then verify that completion generation works for fish, powershell, and zsh.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100