Table of Contents
GroIMP arguments
GroIMP will can receive and use arguments in the command line. Such arguments can be either used by groimp, or forwarded to the project, and accessible there.
java -jar core.jar –project-tree
The command above can be split in two:
- the java command and arguments
- the GroIMP arguments
The additional java arguments are inserted AFTER the -jar core.jar argument.
In the given example, the GroIMP argument is –project-tree.
Most common arguments
A non exhaustive list of common Java arguments used with GroIMP:
–project-treethis argument is used when GroIMP is run in Eclipse, it tells GroIMP to load classes under the local /PLUGIN/target/classes/ repositories where PLUGIN is the name of each directories at the root of GroIMP. This path is different when GroIMP is run after packaging. By default GroIMP load classes in ./plugins/PLUGIN/PLUGIN.jar where PLUGIN is the name of each plugins.–headlessthis argument start GroIMP headless, i.e. without a graphical interface. Usually you also define the project to open as an argument.-a apithis argument defines which application will be started (current available application:imp,cli,api). By default GroIMP starts withimp.-p /path/to/a/directory/link a directory to the list of loaded plugins.path/to/a/model.gszthis argument requires to be used last. It gives a model to be opened after start.
Project arguments
It is possible to forward parameters from the command line to the GroIMP simulation using additional parameters beginning with an capital X.
so for a variable called number with the value 5 the additional parameter would be -Xnumber=5. This value can than in the simulation be recalled by Main.getProperty(“number”)
A tutorial for this can be found here
Note: if you run GroIMP from Eclipse, the GroIMP arguments can be set in the Run Configuration…>x() = Arguments>Program arguments
Exhaustive list of arguments
a
-a {application} this argument defines which application will be started (current available application: GUI, cli, api). By default GroIMP starts with GUI.
e.g. -a api.
cmd
-- -cmd "/path/to/command" run a specific GroIMP command when starting GroIMP
headless
--headless this argument start GroIMP headless, i.e. without a graphical interface. Usually you also define the project to open as an argument.
' ' model
' ' {path/to/a/model.gsz} this argument requires to be used last. It gives a model to be opened after start. The ' ' represent a white space.
p
-p {/path/to/a/directory/} link a directory to the list of loaded plugins.
P
Parameter value & PM file
project-tree
--project-tree this argument is used when GroIMP is run in Eclipse, it tells GroIMP to load classes under the local /PLUGIN/target/classes/ repositories where PLUGIN is the name of each directories at the root of GroIMP. This path is different when GroIMP is run after packaging. By default GroIMP load classes in ./plugins/PLUGIN/PLUGIN.jar where PLUGIN is the name of each plugins.
t
-t {/path/to/config/file}. It makes GroIMP use the config file as main option.
X
-Xvar=value
