<?xml version="1.0" encoding="UTF-8"?> <!-- User Manual for Gramps - a GTK+/GNOME based genealogy program Copyright (C) 2003 Alexander Roitman Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License (GFDL), Version 1.1 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the file COPYING-DOCS distributed with this manual. --> <!-- $Id$ --> <!-- =============== Appendices Subsection ================ --> <sect2 id="append-cmdline"> <title>Befehlszeilenreferenz</title> <para>Dieser Anhang liefert eine Referent über die Möglichkeiten, wenn Sie &app; aus dem Terminal starten.</para> <para>Lassen Sie uns anmerken, dass &app; als ein interaktives Program entworfen wurde. Deshalb benutzt es eine grafische Ansicht und kann nicht von eine echten nicht-grafischen Konsole gestartet werden. Es würde einen enormen Aufwand darstellen eine Ausführung in einem Nur-Text Terminal zu ermöglichen. Aus diesem Grund zielen die möglichen Befehlszeilenparameter nicht darauf ab, komplett auf die grafisch Anzeige zu verzichten. Eher machen sie einige typische Aufgaben angenehmer. Sie erlauben Ihnen auch diese Aufgaben aus Skripten heraus auszuführen. Jedenfalls muss die grafische Anzeige immer verfügbar sein!</para> <para>Zusammengefasst bietet die Benutzung der Befehlzeilenparameter nicht-interaktives Verhalten, aber beseitigt nicht die Abhängigkeit von der grafischen Anzeige. Take it or leave it! </para> <sect3 id="cmdline-options"> <title>Verfügbare Parameter</title> <para>Hier ist ein Liste der möglichen Parameter in &app;:</para> <variablelist> <varlistentry><term>Format-Parameter</term> <listitem><para>Das Format der Dateien für den Import oder Export kann festgelegt werden mit dem <command>-f</command> <replaceable>Format</replaceable> Parameter. <replaceable>Format</replaceable> kann eines der folgenden sein: <variablelist> <varlistentry><term>gramps</term> <listitem><para> &app;-Datenbank. Dieses Format ist sowohl für den Import als auch für den Export verfügbar. Falls nicht gegeben wird es geraten, wenn der Dateiname ein Verzeichnis darstellt.</para></listitem> </varlistentry> <varlistentry><term>gedcom</term> <listitem><para> GEDCOM-Datei. Dieses Format ist für den Import und den Export vefügbar. Falls nicht angegeben wird es geraten, wenn der Dateiname mit .ged endet. </para></listitem></varlistentry> <varlistentry><term>gramps-pkg</term> <listitem><para> &app;-Paket. Dieses Format ist für den Import und Export verfügbar. Falls nicht angegeben wird es geraten, wenn der Dateiname mit .tgz endet. </para></listitem></varlistentry> <varlistentry><term>wft</term> <listitem><para> Web Family Tree. Dieses Format ist nur für den Export verfügbar. Falls nichts angegeben wird es geraten, wenn der Dateiname mit .wft endet. </para></listitem></varlistentry> <varlistentry><term>iso</term> <listitem><para> CD-Image. Dieses Format ist nur für den Export vefügbar. Es muss immer ausdrücklich angegeben werden. </para></listitem></varlistentry> </variablelist> </para></listitem> </varlistentry> <varlistentry><term>Import-Parameter</term> <listitem><para>Die für den Import vorgesehenden Dateien können mit dem <command>-i</command> <replaceable>Dateiname</replaceable> Parameter angegeben werden. Das Format kann mit dem <command>-f</command> Parameter, der sofort auf dem <replaceable>Dateiname</replaceable> folgt. Falls es nicht angegeben wird, wird versucht das Format aus dem <replaceable>Dateiname</replaceable>n zu ermitteln. Für das<term>gramps</term>-Format, ist <replaceable>Dateiname</replaceable> der Name eines Verzeichnisses, unter dem sich die gramps Datenbank befindet. Für <term>gedcom</term> und <term>gramps-pkg</term> ist <replaceable>Dateiname</replaceable> des Name der entsprechenden Datei.</para> <para>Falls mehr als eine Eingabedatei angegeben wird, muss jeder einem <command>-i</command> folgen. Die Dateien werden in der angegebenen Reihenfolge importiert, z.B. <command>-i</command> <replaceable>Datei1</replaceable> <command>-i</command> <replaceable>Datei2</replaceable> und <command>-i</command> <replaceable>Datei2</replaceable> <command>-i</command> <replaceable>Datei1</replaceable> könnte verschiedene gramps-IDs in der resultierenden Datenbank resultieren. </para></listitem> </varlistentry> <varlistentry><term>Export options</term> <listitem><para> The files destined for export can be specified with the <command>-o</command> <replaceable>filename</replaceable> option. The format can be specified with the <command>-f</command> option immediately following the <replaceable>filename</replaceable>. If not specified, the guess will be attempted based on the <replaceable>filename</replaceable>. For <term>gramps</term> and <term>iso</term> formats, the <replaceable>filename</replaceable> is actually the name of directory the gramps database will be written into. For <term>gedcom</term>, <term>wft</term>, and <term>gramps-pkg</term>, the <replaceable>filename</replaceable> is the name of the resulting file. </para> <para> When more than one output file is given, each has to be preceded by <command>-o</command> flag. The files are written one by one, in the specified order. </para></listitem> </varlistentry> <varlistentry><term>Action options</term> <listitem><para> The action to perform on the imported data can be specified with the <command>-a</command> <replaceable>action</replaceable> option. This is done after all imports are successfully completed. Currently available actions are <term>summary</term> (same as <menuchoice><guimenu>Reports</guimenu><guisubmenu>View</guisubmenu> <guimenuitem>Summary</guimenuitem></menuchoice>) and <term>check</term> (same as <menuchoice><guimenu>Tools</guimenu> <guisubmenu>Database Processing</guisubmenu> <guimenuitem>Check and Repair</guimenuitem></menuchoice>). </para> <para>When more than one output action is given, each has to be preceded by <command>-a</command> flag. The actions are performed one by one, in the specified order. </para></listitem> </varlistentry> </variablelist> </sect3> <sect3 id="cmdline-operation"> <title>Operation</title> <para>The order of <command>-i</command>, <command>-o</command>, or <command>-a</command> 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).</para> <para>If no <command>-i</command> 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).</para> <para>If no <command>-o</command> or <command>-a</command> options are given, gramps will launch its main window and start the usual interactive session with the database resulted from all imports. This database resides under <replaceable>~/.gramps/import</replaceable> directory.</para> <para>Any errors encountered during import, export, or action, will be either dumped to stdout (if these are exceptions handled by gramps) or or to stderr (if these are not handled). Use usual shell redirections of stdout and stderr to save messages and errors in files.</para> </sect3> <sect3 id="cmdline-examples"> <title>Examples</title> <para>To import four databases (whose formats can be determined from their names) and then check the resulting database for errors, one may type:</para> <para><command>gramps -i</command> <replaceable>file1.ged</replaceable> <command>-i</command> <replaceable>file2.tgz</replaceable> <command>-i</command> <replaceable>~/db3</replaceable> <command>-i</command> <replaceable>file4.wft</replaceable> <command>-a</command> <replaceable>check</replaceable> </para> <para>To explicitly specify the formats in the above example, append filenames with appropriate <command>-f</command> options:</para> <para><command>gramps -i</command> <replaceable>file1.ged</replaceable> <command>-f</command> <replaceable>gedcom</replaceable> <command>-i</command> <replaceable>file2.tgz</replaceable> <command>-f</command> <replaceable>gramps-pkg</replaceable> <command>-i</command> <replaceable>~/db3</replaceable> <command>-f</command> <replaceable>gramps</replaceable> <command>-i</command> <replaceable>file4.wft</replaceable> <command>-f</command> <replaceable>wft</replaceable> <command>-a</command> <replaceable>check</replaceable> </para> <para>To record the database resulting from all imports, supply <command>-o</command> flag (use <command>-f</command> if the filename does not allow gramps to guess the format):</para> <para><command>gramps -i</command> <replaceable>file1.ged</replaceable> <command>-i</command> <replaceable>file2.tgz</replaceable> <command>-o</command> <replaceable>~/new-package</replaceable> <command>-f</command> <replaceable>gramps-pkg</replaceable> </para> <para>To save any error messages of the above example into files <replaceable>outfile</replaceable> and <replaceable>errfile</replaceable>, run:</para> <para><command>gramps -i</command> <replaceable>file1.ged</replaceable> <command>-i</command> <replaceable>file2.tgz</replaceable> <command>-o</command> <replaceable>~/new-package</replaceable> <command>-f</command> <replaceable>gramps-pkg</replaceable> ><replaceable>outfile</replaceable> 2><replaceable>errfile</replaceable> </para> <para>To import three databases and start interactive gramps session with the result:</para> <para><command>gramps -i</command> <replaceable>file1.ged</replaceable> <command>-i</command> <replaceable>file2.tgz</replaceable> <command>-i</command> <replaceable>~/db3</replaceable> </para> <para>Finally, to start normal interactive session type:</para> <para> <command>gramps </command></para> </sect3> </sect2>