Repository navigation
Conversation
Add SubcommandPlaceholder field to UsageHeaders so consumers can customize the synopsis text (e.g. show "[command]" instead of "[subcommand]"). Defaults to "subcommand" to preserve existing behavior.
Adds opt-in Tab-completion for any Ra-based CLI. When enabled, Ra recognizes a hidden __complete subcommand that the shell shim invokes on Tab press. The Go-side algorithm determines context (subcommand, flag name, flag value, positional) and returns candidates with a directive bitmask. Completion is context-aware: - Walks the subcommand tree (handles interleaved flags) - Tracks used flags to avoid re-offering non-slice flags - Respects -- separator (positional-only after it) - Handles variadic positionals (keeps completing them) - Supports --flag=val and -f=val inline syntax - Hides hidden and positional-only flags - Completes enum values for constrained StringFlags - Supports custom CompletionFunc on all value-taking flag types for dynamic completions (e.g. git branches) Includes bash and zsh shim generators via GenBashCompletion/GenZshCompletion. Fish/PowerShell can be added later following the same pattern. Follows the existing sentinel error pattern (HelpInvokedErr, DumpInvokedErr) so ParseOrExit exits cleanly and ParseOrError returns CompletionInvokedErr.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See individual commits for details.