-
Notifications
You must be signed in to change notification settings - Fork 138
Add shell completion generation support via clap_complete with comprehensive shell coverage #1889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: chris-oo <[email protected]>
…etion support Co-authored-by: chris-oo <[email protected]>
@copilot: Three things:
|
Documented both xtask and openvmm completion features with examples focused on bash and PowerShell. Examples use user-local paths avoiding global system changes. Co-authored-by: mattkur <[email protected]>
I've updated the Guide with comprehensive shell completion documentation focused on bash and PowerShell. The examples use user-local paths like |
@copilot - Actually, please provide completions for fish and zsh as well. |
Co-authored-by: chris-oo <[email protected]>
I've added comprehensive fish and zsh completion examples to both the xtask and openvmm documentation. The examples include setup instructions for both static and dynamic completions using user-local paths that don't require global system changes. (497d775) |
Implements completion generation via
clap_complete
as requested in #1886, providing both enhanced dynamic completions and new static completion options for all major shells including bash, PowerShell, fish, and zsh.Features Added
xtask Enhancements
Expanded Dynamic Completions: The existing
xtask completions
command now supports all shells available in the underlyingclap_dyn_complete
system:xtask completions fish
)xtask completions powershell
)xtask completions zsh
) - previously the only optionNew Static Completions: Added
xtask generate-completions
command usingclap_complete
for traditional static completion generation:xtask generate-completions bash
)xtask generate-completions elvish
)xtask generate-completions fish
)xtask generate-completions powershell
)xtask generate-completions zsh
)openvmm Binary Support
Added
--generate-completions <shell>
flag to the main openvmm binary for static completion generation usingclap_complete
. This follows the existing pattern of utility flags like--write-saved-state-proto
that perform an action and exit.Comprehensive Documentation
Added detailed completion setup instructions to the Guide with examples for all major shells including bash, PowerShell, fish, and zsh:
Guide/src/dev_guide/dev_tools/xtask.md
with comprehensive shell completion sectionGuide/src/reference/openvmm/management/cli.md
Usage Examples
Implementation Details
clap_complete = "4.2"
to workspace dependenciesxtask/src/completions/mod.rs
to support all available shellsopenvmm_entry
CLI args following existing patternsThe implementation provides users with flexible completion options for all major shells: dynamic completions for advanced use cases with runtime logic, and static completions for simpler, faster shell integration across bash, PowerShell, fish, and zsh.
Fixes #1886
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.