Automated shell completions generation#91
Open
WaywardWizard wants to merge 13 commits intoiffy:masterfrom
Open
Automated shell completions generation#91WaywardWizard wants to merge 13 commits intoiffy:masterfrom
WaywardWizard wants to merge 13 commits intoiffy:masterfrom
Conversation
added 13 commits
January 9, 2026 09:49
Move CLI types to src/argparse/types.nim and add: - shellcompletion framework in src/argparse/shellcompletion/*.nim - fish implementation at src/argparse/shellcompletion/fish.nim - extend option signature in src/argparse.nim to accept completion generators - update backend to use the new types and hook completion short-circuit behaviour - add .gitignore entries for .zed and *.out and a test stub
Export types from several modules and add argparse/util.nim for shared helpers.
Rework shell completion generation: produce a single COMPLETION_DEFINITIONS
const from compile-time templates and provide a runtime lookup to replace
{prog}. Short-circuit behavior now parses the chosen shell string and writes
completions. Remove ShortCircuit.handler field. Fix fish completion long-flag
slicing and minor formatting/cleanup changes.
Correct the countdown call in hideCompletions to iterate components from last to first. Make fish completion generation include argument components by removing the kind filter. Add tests for hiding completions and for completion generators, and tidy up test output checks.
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.
This PR introduces automated shell completions for the fish shell (its the only shell that has a declarative completion specification format)
It includes scaffolding/framework for including other shells