If the first argument on the command line does not start with dash (i.e. no flag), GRAMPS will attempt to open the file with the name given by the first argument and start interactive session, ignoring the rest of the command line arguments.
If the -O flag is given, then GRAMPS will try opening the supplied file name and then work with that data, as instructed by the further command line parameters.
Only one file can be opened in a single invocation of GRAMPS. If you need to get data from multiple sources, use the importing options by using -i flag.
With or without the -O flag, there could be multiple imports, exports, and actions specified further on the command line by using -i, -o, and -a flags.
The order of -i, -o, or -a options with respect to each does not matter. The actual execution order always is: all imports (if any) -> all exports (if any) -> all actions (if any).
But opening must always be first!
If no -O or -i option is given, GRAMPS will launch its main window and start the usual interactive session with the empty database, since there is no data to process, anyway.
If no -o or -a options
are given, GRAMPS will launch its main window and start the usual
interactive session with the database resulted from opening and all
imports (if any). This database resides in the
import_db.grdb file under the
Any errors encountered during import, export, or action, will be either dumped to stdout (if these are exceptions handled by GRAMPS) or to stderr (if these are not handled). Use usual shell redirections of stdout and stderr to save messages and errors in files.