feat(tpagectl): implement completion command #583
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/thwap-pagesd!583
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/cli-completion"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Implements the
completioncommand using the urfave/cli v3 framework's built-in completion support.EnableShellCompletion: true, which registers the built-incompletioncommand withbash,zsh,fish, andpwsh(PowerShell) subcommands that emit the framework's embedded autocomplete scripts (#243).ConfigureShellCompletionCommandunhides the command so it appears intpagectl --help.Why
Phase 5 roadmap task #245.
Testing
completioncompletion --helplists bash/zsh/fish/pwsh subcommandstpagectlbinary (pwsh derives it from$MyInvocation)go test -race ./...passes (21 packages)golangci-lint runcleanBreaking Changes
None.
Notes
#244 says "follow cobra's built-in completion support", but the CLI framework is urfave/cli v3 (chosen in #147), so we follow its built-in completion support instead — the roadmap reference is noted as a deviation.
Closes #243
Closes #244
Closes #245
Summary
completioncommand for tpagectl using urfave/cli v3's built-in shell completion. Verified:go test -race ./...passes (21 packages) andgolangci-lint run ./...is clean. Closes #243-245.Verified framework usage:
EnableShellCompletion: trueregisters cli v3's built-incompletioncommand withbash/zsh/fish/pwshsubcommands (confirmed in the module source), andConfigureShellCompletionCommandunhides it correctly fortpagectl --help.No blocking issues; no new issues filed.
References (covered by existing issues)
completion(likeversion) runs the rootBeforehook, so an invalid server config would break completion even though it never contacts the daemon — extends #582.Note
#244 says "follow cobra's built-in completion support", but the CLI framework is urfave/cli v3 (chosen in #147); the PR documents the deviation and honors the intent (use the framework's built-in completion). Acceptable.
Praise
ConfigureShellCompletionCommand--helplists all shells, each shell emits a non-empty script referencing the binary