With paraview 5.10,
pvbatch --displays=0 my-script --my-flag=xxx
fails with unknown option --my-flag=xxx
. I also tried
pvbatch --displays=0 my-script -- -my-flag=xxx
and I get the same error. This worked with paraview 5.9. Is there a way to pass an arg starting with “–” to the script?
> cat /tmp/foo.py
import sys
print("Args: ", sys.argv)
./bin/pvbatch -- /tmp/foo.py foo
Args: ['/tmp/foo.py', 'foo']
Thanks, it looks like flag --display
is acting strangely.
pvbatch --mpi /tmp/foo.py --foo
works as expected
pvbatch --displays=0 /tmp/foo.py --foo
fails with unknown option --foo
.
pvbatch --displays 0 /tmp/foo.py --foo
fails in the same way.
pvbatch --displays=0 /tmp/foo.py
fails with
( 0.122s) [pvbatch ] pvpython.h:95 ERR| No script specified. Please specify a batch script or use 'pvpython'.
Try this instead:
pvbatch --displays=0 -- /tmp/foo.py --foo
Note the --
separator added just before the Python script is specified. That helps break which command line args are processed by ParaView and which ones are passed on to the Python interpreter.