Compact error output, fix four-dash bug, improve error messages#1550
Merged
garrytrinder merged 5 commits intomainfrom Feb 26, 2026
Merged
Compact error output, fix four-dash bug, improve error messages#1550garrytrinder merged 5 commits intomainfrom
garrytrinder merged 5 commits intomainfrom
Conversation
- Suppress help text on parse errors using ParseErrorAction.ShowHelp = false - Fix four-dash bug in JwtCommand.cs: jwtSigningKeyOption.Name already includes '--' - Improve error messages across all validators for consistency: - Wrap invalid values in quotes for clarity - Add actionable hints (examples, allowed values) - Use consistent formatting pattern Co-authored-by: waldekmastykarz <11164679+waldekmastykarz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve error messages for validation and formatting issues
Compact error output, fix four-dash bug, improve error messages
Feb 25, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to make Dev Proxy CLI parse/validation failures more readable by suppressing automatic help output on parse errors and by standardizing validator error messages to be more actionable.
Changes:
- Suppress System.CommandLine help text on parse errors by setting
ParseErrorAction.ShowHelp = false. - Standardize several option validator error messages (config file, IP address, log level, timeout, log-for) to quote invalid input and provide guidance.
- Adjust JWT signing-key validator error formatting.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| DevProxy/Commands/DevProxyCommand.cs | Suppresses help output on parse errors and improves several validator error messages for consistency/actionability. |
| DevProxy/Commands/JwtCommand.cs | Updates the signing-key validator error message formatting. |
garrytrinder
approved these changes
Feb 26, 2026
Contributor
garrytrinder
left a comment
There was a problem hiding this comment.
Tested: builds clean. Help text suppressed on validation errors. Four-dash bug fixed (--signing-key). All error messages are actionable with quoted values and valid alternatives (IP, log level, timeout, config file, output format). Exit code 2 for validation errors. LGTM.
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.
Parse errors dump 40+ lines of help text after a one-line error, burying the actual problem. The JWT signing-key validator produces
----signing-key(four dashes) because.Namealready includes the--prefix.Changes
ParseErrorAction.ShowHelp = falsewhen the parse result action is aParseErrorAction— uses the built-in System.CommandLine beta5 API rather than custom middlewareJwtCommand.cs:$"'--{option.Name}'"→$"'{option.Name}'"sinceNamealready returns--signing-key'X' is not a valid IP address. Example: 127.0.0.1'X' is not a valid log level. Allowed values: Trace, Debug, …'X' is not a valid timeout value. Specify a positive integer (in seconds).Configuration file 'X' does not exist. Check the file path and try again.'X' is not a valid log-for value. Allowed values: Human, MachineWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
aka.ms/usr/bin/dotnet dotnet exec DevProxy/bin/Debug/net10.0/devproxy.dll --ip-address not-an-ip(dns block)/usr/bin/dotnet dotnet exec DevProxy/bin/Debug/net10.0/devproxy.dll jwt create --signing-key short(dns block)/usr/bin/dotnet dotnet exec DevProxy/bin/Debug/net10.0/devproxy.dll --ip-address not-an-ip 0 -j ACCEPT(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.