Improve CLI argument handling for task runner with trailing_var_arg#290
Merged
branchseer merged 2 commits intomainfrom Mar 24, 2026
Merged
Improve CLI argument handling for task runner with trailing_var_arg#290branchseer merged 2 commits intomainfrom
branchseer merged 2 commits intomainfrom
Conversation
Use `value_names = ["TASK_SPECIFIER", "ADDITIONAL_ARGS"]` so the help output shows `[TASK_SPECIFIER] [ADDITIONAL_ARGS]...` instead of the generic `[TASK_AND_ARGS]...`. https://claude.ai/code/session_018viAL2UGVNfLuUjTsi44HQ
Note that omitting the task specifier in an interactive terminal opens an interactive task selector. https://claude.ai/code/session_018viAL2UGVNfLuUjTsi44HQ
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
This PR updates the vp run CLI parsing to ensure that once the task name is provided, all remaining tokens are forwarded verbatim to the underlying task process (preventing clap from consuming task-intended flags like -v), and refreshes the related help/usage output.
Changes:
- Configure clap
trailing_var_argat theRunCommand(command) level instead of on the positional field. - Improve argument/help metadata for the task + passthrough-args positional (value names + long help).
- Update a plan snapshot to match the new generated usage text.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/vite_task/src/cli/mod.rs | Moves trailing_var_arg to the command level and updates help/value names for passthrough args. |
| crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache and --no-cache conflict.snap | Updates expected clap-generated usage output for the renamed positional value placeholders. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
Merge activity
|
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.
Summary
This PR improves the command-line argument handling for the
vp runcommand by properly configuring clap'strailing_var_argfeature at the command level and enhancing documentation around argument parsing behavior.Key Changes
trailing_var_argto command level: Moved thetrailing_var_arg = trueattribute from the individualtask_and_argsfield to theRunCommandstruct itself, which is the correct way to configure this behavior in clapvpitself must appear before the task name, while all tokens after the task name are passed through verbatim to the tasktask_and_argsfield with clearer value names (TASK_SPECIFIERandADDITIONAL_ARGS) and a more descriptive long help message that explains the interactive task selector fallbackinto_resolvedmethod: Improved code clarity by explicitly binding intermediate values before constructing theResolvedRunCommandImplementation Details
The change ensures that clap stops matching flags once the trailing positional argument (task name) starts being filled. This prevents flags like
-vfrom being intercepted when they're intended for the task process. Flags forvpitself (e.g.,--verbose,-r) must now appear before the task name.Relates to: #285
https://claude.ai/code/session_018viAL2UGVNfLuUjTsi44HQ