Warn on unknown command line arguments #98895
Open
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.
This eases troubleshooting when working with command line arguments.
Warnings are only printed if the argument does not exist as a file or directory path (relative or absolute). This allows positional arguments to keep working as they are now, without printing warnings when a project reads positional arguments to perform operations on files (e.g. when drag-and-dropping a file onto a project executable).
This now prints a warning:
This still doesn't print a warning, as it's an user argument (projects can check for invalid arguments on their own):
This doesn't print a warning if the file/folder path exists:
A warning is still printed if the file/folder doesn't exist. Drag-and-drop associations always refer to existing files/folders, so that scenario was unlikely to be encountered.