dimanche 8 mars 2015

Is there a way to make `open -a` pass command line arguments to the app it launches?


I'd like to run OpenSCAD from the command line with some arguments.



$ open -a openscad myfile.scad


works as I expect.



$ open -a openscad --args --help


reports



LSOpenURLsWithRole() failed for the application /Applications/OpenSCAD.app with error -10810.


when OpenSCAD is not already running. When OpenSCAD is already running, then open -a openscad --args --help simply brings OpenSCAD to the foreground.


What I really need is for this to work:



$ open -a openscad --args -o myfile.stl myfile.scad


which works just like my previous example. What should I do to launch OpenSCAD with command line arguments?


Before hitting submit I reproduced my questions for pasting here, and I found a solution that more-or-less works. All of these seem to do what I expect, even if OpenSCAD is not already running.



$ /Applications/http://ift.tt/16v7wdj --help
$ /Applications/http://ift.tt/16v7wdj --args --help
$ /Applications/http://ift.tt/16v7wdj -o ball.stl ball.scad
$ /Applications/http://ift.tt/16v7wdj --args -o ball.stl ball.scad


Still, is there a way to make open -a pass command line arguments to the app it launches?





Aucun commentaire:

Enregistrer un commentaire