Skip to content

Fix MTP command-line parsing#7044

Merged
nohwnd merged 3 commits intomainfrom
dev/ygerges/mtp-parsing
Dec 5, 2025
Merged

Fix MTP command-line parsing#7044
nohwnd merged 3 commits intomainfrom
dev/ygerges/mtp-parsing

Conversation

@Youssef1313
Copy link
Member

@Youssef1313 Youssef1313 commented Dec 3, 2025

It's not correct to consider space as an option-value delimiter.

Fixes #7039

The implementation was previously buggy, and unnecessarily more complicated.

This simplifies the implementation, and makes it more correct.

@Youssef1313 Youssef1313 marked this pull request as ready for review December 3, 2025 21:05
@nohwnd
Copy link
Member

nohwnd commented Dec 4, 2025

Can you please explain here, or in the linked issue what is the problem that is solved, and why it is not correct to consider space as delimiter? I am sure someone will run into this in the future, and it is complicated to figure out what is the intention of this change from the code alone.

@Youssef1313
Copy link
Member Author

In command line, when you type --option value, they end up as two separate arguments (i.e, you have args array of two elements, --option and value. You don't end up with --option value as a single arg. You can end up with --option value as single arg if you enclose it in double quotes in command-line, and in which case I don't think splitting by the space is correct here.

The rest of the logic, as indicated in the linked issue, is already also broken as it can swallow some values. Revising the whole logic, lots of things don't make sense.

@nohwnd nohwnd merged commit 978d8cb into main Dec 5, 2025
11 checks passed
@nohwnd nohwnd deleted the dev/ygerges/mtp-parsing branch December 5, 2025 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MTP command-line parsing is possibly buggy

2 participants