1
$\begingroup$

I have an example of WolframScript file file.wls with the following contents.

#!/usr/bin/env wolframscript

Print["$VersionNumber = ",$VersionNumber];
Print["$ScriptCommandLine = ",$ScriptCommandLine];
If[
    MemberQ[Rest@$ScriptCommandLine,"-h"|"--help"],
    Print["This is help message text."];Quit[0]
];

Then I can call it from command line with > file.wls --option1 --option2 and it prints the contents of $ScriptCommandLine, etc. The problem is that in MMA 11.3 with option -h it prints my custom help message, but in MMA 12 it doesn't execute the script and just prints default WolframScript help message (also obtained by running > wolframscript -h). Other options which don't appear in default list of options work ok (like --somevalue).

Is this a bug in WolframScript of MMA 12? Is there any workaround so I can still use common options like -h in my scripts? (I am working on Windows 10.)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.