Post-Processing Script Parameters #4363
Merged
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 is a solution to #4000.
I didn't realize this before I finished, but #4325 also solves the issue (it did remind me that \ is a poor escaping character for windows). However, that solution prevents ! from being using in any of the arguments or executable name. This one instead splits on whitespace and allows escaping whitespace so it doesn't prevent any filename from being expressed.
Examples:
/path/to/executable
becomes/path/to/executable
with the argoutputfilename.gcode
/path/to/executable -arg -arg2
becomes/path/to/executable
with args-arg
,-arg2
, andoutputfilename.gcode
/path/to/executable! with! spaces -arg -arg2
becomes/path/to/executable with spaces
with args-arg
,-arg2
, andoutputfilename.gcode
/path/to/executable!! -arg -arg2
becomes/path/to/executable!
with args-arg
,-arg2
, andoutputfilename.gcode
The escaping is solved robustly so it should work exactly as programmers would expect (but with ! instead of \ because of Windows). But non programmers may not find it as obvious and people with existing post processing scripts that have whitespace in them may be surprised by their script breaking.
I haven't testing on Windows, but I don't see why it shouldn't work.