cargo icon indicating copy to clipboard operation
cargo copied to clipboard

Correctly parse arguments from environment variables

Open GuillaumeGomez opened this issue 1 year ago • 2 comments

Fixes https://github.com/rust-lang/cargo/issues/14381.

The current parsing doesn't correctly handle arguments like --x="y z". To be noted: if you don't want the dependency, I can write a parser by hand too, shouldn't take many lines of code to do.

r? @epage

GuillaumeGomez avatar Aug 09 '24 10:08 GuillaumeGomez

I'm unsure what the compatibility guarantees are around this. @ehuss if you have any insight, it'd be appreciated.

In general, we recommend starting with an issue. That way we make sure we are all on the same page (e.g. the definition of the problem in this PR is unclear) and, if we go through multiple possible PRs for the problem (which is common enough), the conversation on the problem and solution space is centralized rather than split among all of the PRs.

epage avatar Aug 09 '24 17:08 epage

I opened https://github.com/rust-lang/cargo/issues/14381 too.

GuillaumeGomez avatar Aug 09 '24 19:08 GuillaumeGomez

:umbrella: The latest upstream changes (possibly 39399182abe219c04f3631e0fb5e22cbebdc5f83) made this pull request unmergeable. Please resolve the merge conflicts.

rustbot avatar Feb 10 '25 21:02 rustbot

I'm going to close as this is unlikely the direction that we want to go. Using shlex as-is would be a breaking change (for example a\b would be interpreted differently). If we do decide on some direction, that discussion will likely happen on https://github.com/rust-lang/cargo/issues/14381.

ehuss avatar Feb 10 '25 21:02 ehuss