Skip to content

Conversation

@brbzull0
Copy link
Contributor

@brbzull0 brbzull0 commented Nov 6, 2025

Just a decorative change.

Show attempted subcommand name in error message:

$ traffic_ctl 123
...
Error: No sub-command '123' found for traffic_ctl

Usage: traffic_ctl [OPTIONS] CMD [ARGS ...]
...

before was just:

$ traffic_ctl 123
...
Error: No subcommand found for traffic_ctl

Show attempted subcommand name in error message.
@brbzull0 brbzull0 added this to the 10.2.0 milestone Nov 6, 2025
@brbzull0 brbzull0 self-assigned this Nov 6, 2025
@brbzull0 brbzull0 added the Tools label Nov 6, 2025
@brbzull0 brbzull0 requested a review from Copilot November 6, 2025 12:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances error messaging in the ArgParser when a required subcommand is not found. When a subcommand is required but missing or invalid, the error message now includes the invalid subcommand name (if one was provided) to help users understand what went wrong.

  • Improved error message specificity by including the invalid subcommand name when available
  • Added conditional logic to differentiate between "no subcommand provided" and "invalid subcommand provided"
  • Used std::ostringstream for message construction instead of simple string concatenation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@brbzull0 brbzull0 merged commit 8c0bcad into apache:master Nov 11, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants