- o_nspl = optparse.Option("--ns-port-log",
- metavar="<ns_port_log_file>",
- type="string",
- action="store",
- dest="ns_port_log_file",
- help=help_str)
-
- # All options
- opt_list = [o_t,o_g, # GUI/Terminal
- o_d,o_o, # Desktop
- o_b, # Batch
- o_l,o_f, # Use logger or log-file
- o_u, # Execute python scripts
- o_r, # Configuration XML file
- o_x, # xterm
- o_m, # Modules
- o_e, # Embedded servers
- o_s, # Standalone servers
- o_p, # Kill with port
- o_k, # Kill all
- o_i, # Additional python interpreters
- o_z, # Splash
- o_c, # Catch exceptions
- o_a, # Print free port and exit
- o_n, # --nosave-config
- o_pi, # Interactive python console
- o_nspl]
-
-
- #std_options = ["gui", "desktop", "log_file", "py_scripts", "resources",
- # "xterm", "modules", "embedded", "standalone",
- # "portkill", "killall", "interp", "splash",
- # "catch_exceptions", "print_port", "save_config", "ns_port_log_file"]
-
- opt_list += theAdditionalOptions
-
- a_usage = "%prog [options] [STUDY_FILE]"
- version_str = "Salome %s" % version()
- pars = optparse.OptionParser(usage=a_usage, version=version_str, option_list=opt_list)
+ pars.add_argument("--ns-port-log",
+ metavar="<ns_port_log_file>",
+ dest="ns_port_log_file",
+ help=help_str)
+
+ # Write/read test script file with help of TestRecorder. Default: False.
+ help_str = "Write/read test script file with help of TestRecorder."
+ pars.add_argument("--test",
+ metavar="<test_script_file>",
+ dest="test_script_file",
+ help=help_str)
+
+ # Reproducing test script with help of TestRecorder. Default: False.
+ help_str = "Reproducing test script with help of TestRecorder."
+ pars.add_argument("--play",
+ metavar="<play_script_file>",
+ dest="play_script_file",
+ help=help_str)
+
+ # gdb session
+ help_str = "Launch session with gdb"
+ pars.add_argument("--gdb-session",
+ action="store_true",
+ dest="gdb_session",
+ help=help_str)
+
+ # ddd session
+ help_str = "Launch session with ddd"
+ pars.add_argument("--ddd-session",
+ action="store_true",
+ dest="ddd_session",
+ help=help_str)
+
+
+ # valgrind session
+ help_str = "Launch session with valgrind $VALGRIND_OPTIONS"
+ pars.add_argument("--valgrind-session",
+ action="store_true",
+ dest="valgrind_session",
+ help=help_str)
+
+ # shutdown-servers. Default: False.
+ help_str = "1 to shutdown standalone servers when leaving python interpreter, "
+ help_str += "0 to keep the standalone servers as daemon [default]. "
+ help_str += "This option is only useful in batchmode "
+ help_str += "(terminal mode or without showing desktop)."
+ pars.add_argument("-w",
+ "--shutdown-servers",
+ metavar="<1/0>",
+ action=StoreBooleanAction,
+ dest="shutdown_servers",
+ help=help_str)
+
+ # foreground. Default: True.
+ help_str = "0 and runSalome exits after have launched the gui, "
+ help_str += "1 to launch runSalome in foreground mode [default]."
+ pars.add_argument("--foreground",
+ metavar="<1/0>",
+ action=StoreBooleanAction,
+ dest="foreground",
+ help=help_str)
+
+ # wake up session
+ help_str = "Wake up a previously closed session. "
+ help_str += "The session object is found in the naming service pointed by the variable OMNIORB_CONFIG. "
+ help_str += "If this variable is not set, the last configuration is taken. "
+ pars.add_argument("--wake-up-session",
+ action="store_true",
+ dest="wake_up_session", default=False,
+ help=help_str)
+
+ # server launch mode
+ help_str = "Mode used to launch server processes (daemon or fork)."
+ pars.add_argument("--server-launch-mode",
+ metavar="<server_launch_mode>",
+ choices=["daemon", "fork"],
+ dest="server_launch_mode",
+ help=help_str)
+
+ # use port
+ help_str = "Preferable port SALOME to be started on. "
+ help_str += "If specified port is not busy, SALOME session will start on it; "
+ help_str += "otherwise, any available port will be searched and used."
+ pars.add_argument("--port",
+ metavar="<port>",
+ type=int,
+ dest="use_port",
+ help=help_str)
+
+ # Language
+ help_str = "Force application language. By default, a language specified in "
+ help_str += "the user's preferences is used."
+ pars.add_argument("-a",
+ "--language",
+ dest="language",
+ help=help_str)
+
+ # Positional arguments (hdf file, python file)
+ pars.add_argument("arguments", nargs=argparse.REMAINDER)