Repository navigation
fix(cli): complete after a -C directory named like a subcommand - #3609
Open
voidzero-bot[bot] wants to merge 2 commits into
Open
voidzero-bot[bot] wants to merge 2 commits into
voidzero-bot[bot] wants to merge 2 commits into
Conversation
Contributor
CLI artifact sizes (
|
| Artifact | Format | Base | PR | Change |
|---|---|---|---|---|
packages/cli/dist |
Directory total | 2.55 MiB | 2.55 MiB | 0 B (0.00%) |
packages/core/dist |
Directory total | 4.29 MiB | 4.29 MiB | 0 B (0.00%) |
| Combined package dist | Directory total | 6.84 MiB | 6.84 MiB | 0 B (0.00%) |
vp (Linux x64) |
Binary | 9.32 MiB | 9.32 MiB | 0 B (0.00%) |
vp (Linux x64) |
gzip -9 | 4.26 MiB | 4.26 MiB | +289 B (+0.01%) |
| NAPI (Linux x64) | Binary | 38.00 MiB | 38.00 MiB | 0 B (0.00%) |
| NAPI (Linux x64) | gzip -9 | 15.33 MiB | 15.33 MiB | 0 B (0.00%) |
vp (macOS ARM64) |
Binary | 6.12 MiB | 6.12 MiB | +16 B (+0.00%) |
vp (macOS ARM64) |
gzip -9 | 3.65 MiB | 3.65 MiB | +657 B (+0.02%) |
| NAPI (macOS ARM64) | Binary | 44.39 MiB | 44.39 MiB | 0 B (0.00%) |
| NAPI (macOS ARM64) | gzip -9 | 19.42 MiB | 19.42 MiB | 0 B (0.00%) |
vp (Windows x64) |
Binary | 7.28 MiB | 7.28 MiB | +1.00 KiB (+0.01%) |
vp (Windows x64) |
gzip -9 | 3.34 MiB | 3.34 MiB | +1.48 KiB (+0.04%) |
| NAPI (Windows x64) | Binary | 33.88 MiB | 33.88 MiB | 0 B (0.00%) |
| NAPI (Windows x64) | gzip -9 | 14.04 MiB | 14.04 MiB | -4 B (-0.00%) |
| Trampoline (Windows x64) | Binary | 13.50 KiB | 13.50 KiB | 0 B (0.00%) |
| Trampoline (Windows x64) | gzip -9 | 7.09 KiB | 7.09 KiB | 0 B (0.00%) |
| Installer (Windows x64) | Binary | 4.70 MiB | 4.70 MiB | 0 B (0.00%) |
| Installer (Windows x64) | gzip -9 | 2.25 MiB | 2.25 MiB | +1 B (+0.00%) |
|
Cloudflare builds and deploys previews for this pull request. Learn more about Cloudflare previews.
Updated: |
clap_complete's engine looks up subcommand names before it gives a word to a pending option, so `vp -C dev run <TAB>` completed inside `vp dev` and offered no tasks. The parser consumes `dev` as the `-C` value, so the command itself ran in `dev`. Completion now spells a leading `-C` value that names a subcommand or alias as `./<dir>` before the engine reads the request. The word count stays the same, so the cursor index from every shell stays valid. The `-C` peek that changes the directory runs before this rewrite. Closes #3608
fengmk2
force-pushed
the
triagebot/fix-3608
branch
from
December 6, 2026 08:47
8d1c317 to
6793350
Compare
When `-C` named a directory that does not exist, task completion listed the tasks of the invocation directory, where the command never runs. Accepting one then failed with `directory not found`. The completion command for a missing `-C` directory now offers no tasks.
This branch has not been deployed
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.
vp -C dev run <TAB>offered no tasks. clap_complete's engine looks up subcommand names before it gives a word to a pending option, so it routed the completion intovp dev. The parser consumesdevas the-Cvalue, so the command itself ran indev. The-C ./devcase from the issue already works on main since #3190.Completion now spells a leading
-Cvalue that names a subcommand or alias as./<dir>before the engine reads the request. The word count stays the same, so the cursor index from every shell stays valid. The-Cpeek that changes the directory runs before this rewrite. The rewrite can go once clap_complete gives the value to the option first, as its parser does: clap-rs/clap#6590.When
-Cnames a directory that does not exist, task completion offers nothing. Before, it listed the tasks of the invocation directory, where the command never runs.Closes #3608