Manual

Main Command-Line Options

# Command-Line Options

uDraw(Graph) supports the command-line options listed below. Further, the file name of either a term representation file or status file can be used as the last argument when starting uDraw(Graph) in a command-line in order to load a graph at initialization time. In uDraw(Graph), option "-graphedit" and a graph file can now be combined to load the graph initially in the graph editor.

## uDraw(Graph) Command-Line Syntax

    uDrawGraph
                -display <X11-display>
                -font { normal | large | extra_large }
                -graphbg <colorvalue>
                -graphedit
                -graphedit_old
                -help
                -init <init-file>
                -log <log-file>
                -nogui
                -pipe
                -server ?port?
                -startappl <directory> <filename/options>
                -verify
                -version
                -window_api
                <graph-file>

## -display <X11-display>

(This option has no effect on the Windows® platform.) To send the graphical output (i.e. all windows and dialogs) to the specified X11TM display, for example to start uDraw(Graph) on one computer and redirect the user interface to be displayed on another computer. X11TM displays are specified in the format hostname:display.screen, for example: "myhost:0.0".

## -font { normal | large | extra_large }

(This option has no effect on the Windows® platform.) To set the fonts in the dialog windows of the graph editor to a larger size. Fonts larger than the default value "normal" are useful for demonstrations when people should read the text of menus, dialog windows etc. from the distance.

## -graphbg <color>

To set the background of the uDraw(Graph) base window to the specified color. The value of this option can be any X11TM colorname on UNIX® and Linux® platforms (see file lib/X11/rgb.txt in your X11TM directory) or any RGB color specification in a format like "#0f331e", where "0f" is the hexadecimal value for the red part of the color, "33" is the green part and "1e" is the blue.

## -graphedit

To connect the graph editor application at initialization time to the uDraw(Graph) API. The uDraw(Graph) user interface will be slightly different using this option, because uDraw(Graph) starts without the standard user interface (same as option -nogui) and the editor reconfigures it to add some extra menus. In the uDraw(Graph) distribution, the graph editor application is located in directory "bin". The file name of the editor executable file ("grapheditor(.exe)") must not be changed. Environment variable $GRAPHEDITOR_DIRECTORY can be used to specify an alternative directory for the editor. The graph editor can also be connected to uDraw(Graph) at runtime by using menu File/Connect Application....

## -graphedit_old

Same as option -graphedit, but starts the editor in the classic way without taking advantage of the user interface reconfiguration feature.

## -help

Displays a help message to show the options' syntax without actually starting uDraw(Graph).

## -init <init-file>

To pass a file containing a list of initial API commands. The content of the file must be conform to rule uDG_commands of the API grammar, so the file content must begin with "[". The commands in the file are executed immediately after starting uDraw(Graph). You can use all API commands, except those of the categories Multi, Application Menu, Drag & Drop. The answers to these commands you usually get when you send them via API are dropped, if no application is connected. Otherwise they are sent to the application as usual. Use this option carefully when you have connected an application on command-line with the options -pipe, -startappl or -graphedit, because the answers of these initial commands may be unexpected for the application and may result in strange effects.

## -log <log-file>

To create a file where all commands and answers sent and received by the API are logged. In the file, every command sent by a connected application is preceded by "Command:" and every reply sent back by uDraw(Graph) API is preceded by "Answer:".

Use - as filename (i.e. "-log -") when your application is connected to the API via sockets (option -server) and you want to see log messages printed on stdout instead of the file. Logging on stdout is not possible when you use option -pipe, because in this case stdout is needed for pipe communication, of course.

## -nogui

This option is used to start uDraw(Graph) without an initial user interface. With this option, application programs connecting to the API must configure the user interface (menus, icons and/or footer area) with API command gui(configure(...)), but without using any API command of category Application Menu. Note: using this option without connecting an application initially (with -graphedit, -pipe or -startappl) is only meaningful when you use option -server, too. In this case you will not see a user interface immediately, but uDraw(Graph) will wait in the background for applications that connect to the API on the designated socket port later.

## -pipe

Used when uDraw(Graph) is started by an application program that connects to the API using pipes. Refer to the API documentation for further details. The same can be done based on socket communication with option -server (see below). With option "-pipe", the API will start listening for commands. Most of the File menu will be deactivated to ensure that the user is unable to remove or exchange a loaded graph without approval by the application, but the application can take control of the "File" menu. You can also use this option to test the uDraw(Graph) API by being able to enter API commands on the command-line after the system has started.

## -server ?port?

Similar to option -pipe (see above), but here the API communication is based on TCP/IP sockets. If the optional port parameter is not given, port 2542 is used which is exclusively registered for uDraw(Graph). So there is usually no need to switch to another port. With sockets, the application can be located on another computer and it can even connect to the API when uDraw(Graph) has already been started, which are both drawbacks of pipe communication. Refer to the API documentation for further details.

Security note: You have to be careful with this option, because after entering the socket server mode, any application can connect to uDraw(Graph) from any computer in the network at any time. Although the Tcl/Tk interface in the API is restricted to a safe Tcl interpreter after using option "-server" (to avoid that the sender of API commands can cause harm, refer to the API documentation for details), a malicious application program can still open a dialog window to ask the uDraw(Graph) user to execute dangerous operations. You have to establish a security policy for the users of your system to avoid "social engineering attacks" like this.

## -startappl <directory> <filename/options>

To connect the application specified by "filename" and located in the given "directory" at initialization time to the uDraw(Graph) API. Note that there has to be an unusual space between the directory and the file name! If options are required in order to start the application then the file name has to be quoted in the shell together with the options. This example starts the application "testappl" in directory "dir" with the given options:

-startappl /bin `testappl -opt1 arg1 arg2 -opt2'

The equivalent operation is to connect the application at run-time with menu File/Connect Application....

## -verify

This option is used for special debugging of the incremental layout algorithm and is not intended for the normal user. With this option, uDraw(Graph) verifies internal data structures after updating a graph with API command graph(update(...)). You should use this option at the start when you get strange effects or bugs after graph updates. The verification might be very complex, so it is usually switched off.

## -version

To show the current version of uDraw(Graph) in the command-line without actually starting the system.

## -window_api

To enable the multi-window feature where a connected application has full control over each base window. This is not the default to ensure compatibility with applications written for previous versions of uDraw(Graph) where only the first base window to a graph was accessible for the application in multi-graph mode. Refer to the command category Multi in the API documentation for more information.