I would like to pass input parameters into my .mp script.
For example, instead of running:
I want to run something like:
mpost script.mp 1 1 2 diamand
Where "1 1 2 diamond" are 4 input parameters telling the script what to do.
At the moment I have things like:
numeric showindices showindices := 0; %showindices := 1; string drawingmode drawingmode := "diamond"; %drawingmode := "square";
I am then running "mpost script.mp" with showindices=0 un-commented, and then separately with showindices=1 un-commented. Likewise I'm running it with drawingmode=diamond un-commented, and then separately with drawingmode=square un-commented.
There's 10 drawing modes and various "switches" similar to showindices, so I don't want to just keep un-commenting and re-commenting different lines. I also don't want to copy and paste the whole script so many times. Perhaps you'll say I can run through all these combinations in a loop, but is there a way to just pass in arguments from the command line, if I wanted for example, "square" drawingmode and "1" for showindices ?