-
Notifications
You must be signed in to change notification settings - Fork 26
CommandLine
Last revision: ver. 8.0.4 - 3 September 2015
All omegalib applications (yes, even the ones you create) support a few predefined command line arguments. If you application needs more, you can also add custom ones.
The predefined command line syntax of an omegalib application is:
omegaApp [file/config] [options] [additional arguments]
The following are the supported options
-
-c configFile
: is the configuration file to use with this application (default: same as the application name with a .cfg extention, or default.cfg if the previous is not found). The-c
option can also be used to manually start slave instances (see section below). -
-?
: prints the full command line reference (predefined AND custom options) -
-K
: kill all application instances, when running on a cluster system -
-D path
: changes the default omegalib data path. The default data path is read from theOMEGA_HOME
environment variable. IfOMEGA_HOME
does not exist, the default data path will point to the source directory of omegalib in the system. Entering-
as the path will force omegalib to use the source directory as the data directory, even if theOMEGA_HOME
environment variable is present. see the filesystem page for more information. -
-L path
: changes the path of the application log file (default: same as the application name with a .log extention). Instead of a file name you can enter the following values:-
v
: turns on verbose logging -
d
: turns on debug logging -
off
disables logging
-
-
-I <tx>,<ty>,<tw>,<th>[,<id>]
: (version 3.7+) sets up multi-instance mode. See the Multi-Instance Guide for more information. -
--mc <default|client|@host[:port]|server[@port]|disable>
: (version 3.7+) sets the mission control mode. Read more in the section below. -
-d
: (version 4.1+) disables the Control+C handler (useful when debugging with gdb) -
-r
: generate a log file for each slave instance in a cluster configuration -
(v6.0)
-w <x>,<y>,<w>,<h>
: The initial canvas for this application. The canvas specifies the initial global pixel viewport of the application. -
(v6.0)
-i
: runs the program in interactive mode, even if the script console is not enabled in the system configuration. -
(v8.0)
--interactive-off
: runs the program in non interactive mode, overriding any configuration setting.
--N <name>
: sets the application name (used as mission control identifier)
On cluster systems, omegalib tries to start slave instances using the nodeLauncher
command template in the configuration file. Slave instances can also be started
manually: they will wait for a connection from the master node and run once all
slaves are connected. To launch an omegalib application in slave mode, use the
configuration command line option in this format:
omegalibApp -c <configName>@<slaveName>:<slavePort>
Where configName
is the name of the configuration the master will use for this
system, slaveName
is the slave node host name or ip address and slavePort
is
the port the slave will listen to for incoming master connections. This port must
correspond to the port specified for the slave in the configuration file.
The --mc
switch speciies the mission control mode for the application. Mission
control allows applications to receive remote commands and create connections to
each other to support collaborative applications. See the
Mission Control Wiki Page for more information about Mission
Control. The --mc
flag supports four modes:
-
default
: this is the default mode (not entering the--mc
switch is the same as entering--mc default
). In this mode the application checks theserverEnabled
variable in the system configuration, and if set to true opens a mission control server on the port specified in the system configuration (port
variable), or using default port 22500. -
server[@port]
: same as default but forces the creation of a server even ifserverEnabled
is set to false in the configuration file. (v5.1+) Optionally specify a port to use for the server. If left nspecified, will use the value from the configuration file. -
client
: this option sets up the application as a mission control client, and attempts connection to a server using theserverHost
andport
variables in the system configuration file. By default, it will try connecting to a local server on the default port. -
@host[:port]
: sets up a mission control client and attempts connecting to a server at the specified host (and optional port if different from default). -
disable
: disables mission control
You can create additional command line arguments for your application, right before calling omain
:
int main(int argc, char** argv)
{
String argString;
bool argFlag;
Application<MyApplication> app("myapp");
oargs().newNamedString('s', "string", "string", "a custom string", argString);
oargs().newFlag('f', "flag", "a custom flag", argFlag);
return omain(app, argc, argv);
}
the oargs()
function uses the ArgumentHelper
class to perform argument parsing. More information about ArgumentHelper
can be found http://graphics.stanford.edu/~drussel/Argument_helper/ here.).