Add completion spec for wsl (Windows Subsystem for Linux)#191
Open
acarl005 wants to merge 1 commit into
Open
Conversation
Add JSON completion spec and Rust generators for the wsl command. The spec covers: - Running Linux binaries with options (-d, -u, -e, --cd, --shell-type, --system) - Distribution management (--install, --list, --set-default, --terminate, --unregister) - Import/export (--export, --import, --import-in-place) - Disk operations (--mount, --unmount) - System management (--manage, --shutdown, --update, --status) - Version management (--set-version, --set-default-version) Generators provide dynamic completions for: - Installed distributions (via wsl.exe --list --quiet) - Online available distributions (via wsl.exe --list --online) Co-Authored-By: Oz <oz-agent@warp.dev>
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.
My Remarks
This is one of the most difficult cases as there is no reference implementation in fish-shell or Fig. It's a good data point for how hard the commands can be to implement.
Oz Run
https://oz.staging.warp.dev/runs/6de6a2e8-3d07-4e9b-b747-03748c4e86ca
Summary
Add completion spec and dynamic generators for
wsl(Windows Subsystem for Linux).The spec was built by inspecting the WSL source code, specifically:
src/windows/inc/wsl.h— all command-line argument definitionssrc/windows/common/WslClient.cpp— argument parsing and subcommand routinglocalization/strings/en-US/Resources.resw— official help text and descriptionsWhat's included
JSON spec (
command-signatures/json/wsl.json)Covers the full
wsl.exeCLI:-d/--distribution,-u/--user,-e/--exec,--cd,--shell-type,--system--install,--list,--set-default,--terminate,--unregister--export(with--format/--vhd),--import(with--version/--vhd),--import-in-place--mount(with--vhd,--bare,--type,--options,--partition,--name),--unmount--manage(with--move,--set-sparse,--set-default-user,--resize),--shutdown,--update,--status--set-version,--set-default-version--help,--version,--debug-shell,--uninstallRust generator (
command-signatures/src/generators/wsl.rs)Two generators for dynamic completions:
distros— lists installed distributions viawsl.exe --list --quietonline_distros— lists available distributions viawsl.exe --list --onlineTesting
cargo test)npm run formatThis PR was generated with Oz.