Setting Properties on the Command Line
2 min read
2 min read
2 min read
2 min read
2 min read
2 min read
2 min read
2 min read
2 min read
In addition to setting properties in a configuration file, you can also set properties on the command line, for example:
server --Ice.UDP.SndSize=65535 --IceSSL.Trace.Security=2When you pass arguments to communicator initialization, Ice converts options beginning with --, a reserved prefix, and a dot into property settings. For example, --Ice.Trace.Network=1 matches, while --IceFoo=1 remains an application argument. Property settings on the command line override settings in a configuration file. If you set the same property more than once on the same command line, the last setting overrides any previous ones.
Ice applies the same property validation to command-line options as to any other property, so a typo such as --Ice.Trace.Netwrok=1 makes communicator initialization fail with a PropertyException.
The initialization overloads that update the argument array remove the options they consume. Other overloads leave the input unchanged or return the remaining arguments separately; see Communicator Initialization and Destruction.
For convenience, any property not explicitly set to a value is set to the value 1. For example,
server --Ice.Trace.Protocolis equivalent to
server --Ice.Trace.Protocol=1Note that this feature only applies to properties that are set on the command line, but not to properties that are set from a configuration file. In mappings that load configuration files, a bare --Ice.Config becomes Ice.Config=1, which tells Ice to use the ICE_CONFIG environment variable.
You can also clear a property from the command line as follows:
server --Ice.Trace.Protocol=As for properties set from a configuration file, assigning nothing to a property clears that property.