Add support for extra script arguments #18
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 PR allows passing extra arguments to the user script. For example, calling
perftree ./program.exe a bwill result indiffmaking this call:./program.exe a b <depth> <fen> <moves>.With this change I was able to run my program through a bash script on Windows with git bash
perftree "C:\Program Files\Git\bin\bash.exe" ./fox-perftree.shso I think this would close #7.I have setup my program to run perft when called like so:
./program.exe perft <depth> <fen> <moves>. I tried to setup a script to call my program like this, but was not able to get it working on Windows:perftree .\script.ps1then I got this error:cannot compute diff: failed to execute user script: %1 is not a valid Win32 application. (os error 193)perftree powershell .\script.ps1means it callspowershell <depth> <fen> <moves>.perftree "powershell .\script.ps1"then I got this errorcannot compute diff: failed to execute user script: The system cannot find the path specified. (os error 3)I was not able to run my program though a powershell script because it interpreted each space in the fen as a separate argument. This should be fixable by adding parsing logic in my script or my program, but I don't care to put in the effort for that. This is consistent with the
Command.arg()documentation https://doc.rust-lang.org/stable/std/process/index.html#windows-argument-splitting.For completeness just before posting this I tested using Windows Command Line Batch script. That just worked, this change is not necessary to use that. Oh well.