Skip to content

Conversation

@Ananth-R-Bits
Copy link
Contributor

@Ananth-R-Bits Ananth-R-Bits commented Jan 31, 2026

Update command-line argument handling and error message.

Summary

The code was using return when a command wasn't found, which exits the entire loop and prevents processing of subsequent commands.

Solutions Applied:

  1. Added flag detection: Check if the argument starts with / or - (common command-line flag prefixes) and skip it with continue instead of trying to find it as a command.

  2. Changed return to continue: When a command is not found, use continue to skip only the current iteration and move to the next command in the list, rather than exiting the entire method.

  3. Improved error messages: Added the actual command name to error messages for better debugging.
    This way, /d (and other flags) will be skipped, and valid commands in the args array will still be processed.

Fixes #48281


Internal previews

📄 File 🔗 Preview link
docs/core/tutorials/creating-app-with-plugin-support.md Create a .NET Core application with plugins

Update command-line argument handling and error message.
@Ananth-R-Bits Ananth-R-Bits requested review from a team and meaghanlewis as code owners January 31, 2026 15:16
@dotnetrepoman dotnetrepoman bot added this to the January 2026 milestone Jan 31, 2026
@dotnet-policy-service dotnet-policy-service bot added dotnet-fundamentals/svc community-contribution Indicates PR is created by someone from the .NET community. labels Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates PR is created by someone from the .NET community. dotnet-fundamentals/svc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with logic when comparing args with command names.

1 participant