Skip to content

fix: preserve colon arguments in bash completions#2408

Open
puneetdixit200 wants to merge 1 commit into
spf13:mainfrom
puneetdixit200:fix/2376-bash-colon-completion
Open

fix: preserve colon arguments in bash completions#2408
puneetdixit200 wants to merge 1 commit into
spf13:mainfrom
puneetdixit200:fix/2376-bash-colon-completion

Conversation

@puneetdixit200

@puneetdixit200 puneetdixit200 commented May 22, 2026

Copy link
Copy Markdown

Fixes #2376.

Summary

  • rejoin Bash words split around : before Cobra calls __complete
  • keep ValidArgsFunction receiving URI-like values such as local:/ as the active argument
  • add a Bash-driven regression test for the split local : / case

Tests

  • GOMODCACHE=$PWD/.gomodcache GOCACHE=$PWD/.gocache go test ./ -run TestBashCompletionV2RejoinsColonWordbreak -count=1 (failed before the fix)
  • GOMODCACHE=$PWD/.gomodcache GOCACHE=$PWD/.gocache go test ./ -run 'TestBashCompletionV2(RejoinsColonWordbreak|WithActiveHelp)' -count=1
  • GOMODCACHE=/tmp/cobra-2376-gomodcache GOCACHE=/tmp/cobra-2376-gocache make all
  • PATH=/tmp/cobra-2376-bin:$PATH GOMODCACHE=/tmp/cobra-2376-gomodcache GOCACHE=/tmp/cobra-2376-gocache golangci-lint run --new-from-rev=upstream/main --verbose
  • git diff --check

@CLAassistant

CLAassistant commented May 22, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@puneetdixit200 puneetdixit200 force-pushed the fix/2376-bash-colon-completion branch from a93cfe1 to 4292387 Compare May 22, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: ValidArgsFunction receives partial input when argument contains colons in Bash

2 participants