KMessage handles various command line arguments (including all the KDE and Qt command line arguments). The general syntax is:
kmessage [ -center ] [ -nearmouse ] [ -print ] [ -buttons buttons ] [ -default default ][ -file file ] [ -timeout timeout ] message
Forces KMessage to position the window in the center of the screen.
Forces KMessage to position the upper-left corner of the window near the mouse pointer.
The name of the button that is clicked is written to standard output.
Displays a row of buttons as specified in buttons. buttons should be a comma-separated list (without spaces!) of the names of the buttons. buttons defaults to okay.
If buttons is specified the return value of KMessage will be 100+the number of the button pressed (counting from one). In the case that buttons is not specified explicitly on the command line the return value will be 0 (on normal exit).
Gives keyboard focus to the button default. It is wise to give focus to the button that represents the safest choice.
Displays the contents of the file file. If file is equal to - then input is read from standard input until a EOF is encountered.
Displays the window only for timeout seconds.
To get all the available Qt and KDE command line options (such as setting the caption of the window) just type in:
kmessage --help-all