Skip to content

Add native filesystem directory completion for --dir - #170

Draft
MoonCaves wants to merge 4 commits into
mainfrom
feat/native-dir-completion-tick1386
Draft

MoonCaves wants to merge 4 commits into
mainfrom
feat/native-dir-completion-tick1386

Conversation

@MoonCaves

Copy link
Copy Markdown
Owner

Adds Cobra native filesystem directory completion for the existing optional --dir flag on the root command, search, find, and grep. Directory discovery stays with the shell; session-ID and known-project catalog completion remain outside this change.

Validation: freshly built Go 1.24 static binary returns ShellCompDirectiveFilterDirs for all four command forms. The full race-suite log reports ok for every tested package; build, vet, lint, independent source review and the normal pre-push provenance gate completed. Stock Zsh 5.9 also completed the directory, excluding a regular file with the same prefix, through genuine PTY TAB completion on all four command forms.

Configure the existing root/shared --dir flag with Cobra MarkFlagDirname. Root, search, find and grep request shell filesystem directory filtering; this does not enumerate sessions or known projects. Record native API configuration provenance and the bounded roadmap status.

Prior-Art: spf13/cobra shell_completions.go L81-L98 (Apache-2.0) @88b30ab89da2d0d0abb153818746c5a2d30eccec -> internal/cli/cli.go
Prior-Art: spf13/cobra completions.go L75-L80 (Apache-2.0) @88b30ab89da2d0d0abb153818746c5a2d30eccec -> internal/cli/cli.go
Prior-Art: spf13/cobra completions.go L416-L423 (Apache-2.0) @88b30ab89da2d0d0abb153818746c5a2d30eccec -> internal/cli/cli.go
Pass the existing local dir annotation error to Cobra CheckErr instead of discarding it. Attribute the local dir caller and native error handling separately; the upstream test assertion is not an equivalent error policy and no exact paired upstream call is claimed. Preserve the original commit and its rejected gate history.

Prior-Art: spf13/cobra completions_test.go L1160-L1189 (Apache-2.0) @88b30ab89da2d0d0abb153818746c5a2d30eccec -> internal/cli/cli.go
Prior-Art: spf13/cobra cobra.go L234-L241 (Apache-2.0) @88b30ab89da2d0d0abb153818746c5a2d30eccec -> internal/cli/cli.go
Prior-Art: spf13/cobra shell_completions.go L81-L98 (Apache-2.0) @88b30ab89da2d0d0abb153818746c5a2d30eccec -> internal/cli/cli.go
Prior-Art: spf13/cobra completions.go L75-L80 (Apache-2.0) @88b30ab89da2d0d0abb153818746c5a2d30eccec -> internal/cli/cli.go
Prior-Art: spf13/cobra completions.go L416-L423 (Apache-2.0) @88b30ab89da2d0d0abb153818746c5a2d30eccec -> internal/cli/cli.go
Use the actual Cosign local-dir annotation caller, including its ignored result, with only cmd-to-root receiver adaptation. Keep RawClaw dir optional; Cosign's adjacent independent MarkFlagRequired annotation is not adopted. Preserve prior commits and rejected gate history.

Prior-Art: sigstore/cosign cmd/cosign/cli/options/load.go L33-L35 (Apache-2.0) @0743bfcff5f81ec49ffcea2f61b98938f6ba70ec -> internal/cli/cli.go
Prior-Art: spf13/cobra shell_completions.go L81-L98 (Apache-2.0) @88b30ab89da2d0d0abb153818746c5a2d30eccec -> internal/cli/cli.go
Prior-Art: spf13/cobra completions.go L75-L80 (Apache-2.0) @88b30ab89da2d0d0abb153818746c5a2d30eccec -> internal/cli/cli.go
Prior-Art: spf13/cobra completions.go L416-L423 (Apache-2.0) @88b30ab89da2d0d0abb153818746c5a2d30eccec -> internal/cli/cli.go
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.

1 participant