-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
A-cliArea: Command-line interface, option parsing, etc.Area: Command-line interface, option parsing, etc.A-diagnosticsArea: Error and warning messages generated by Cargo itself.Area: Error and warning messages generated by Cargo itself.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.
Description
Problem
When using cargo run
, it can be hard to distinguish output from cargo and output from the spawned executable, especially if both are using clap. Take for example this error:
$ cargo r --exe
error: unexpected argument '--exe' found
tip: to pass '--exe' as a value, use '-- --exe'
Usage: run --features <FEATURES> [ARGS]...
For more information, try '--help'.
and compare it to this one:
$ cargo r -- --exe
error: a value is required for '--exe <filename>' but none was supplied
For more information, try '--help'.
both of these look similar, and it is hard to tell what's happening at a glance.
Proposed Solution
Prefix each error:
diagnostic with cargo:
; the example above would start with cargo: error: unexpected argument '--exe' found
Notes
maybe it sense to do this for everyone upstream in clap instead of just for cargo?
Metadata
Metadata
Assignees
Labels
A-cliArea: Command-line interface, option parsing, etc.Area: Command-line interface, option parsing, etc.A-diagnosticsArea: Error and warning messages generated by Cargo itself.Area: Error and warning messages generated by Cargo itself.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.