<spanid="ref-command-line"></span><h1>The SIP Command Line<aclass="headerlink"href="#the-sip-command-line"title="Permalink to this headline">¶</a></h1>
<p><ttclass="docutils literal"><spanclass="pre">specification</span></tt> is the name of the specification file for the module. If it
is omitted then <ttclass="docutils literal"><spanclass="pre">stdin</span></tt> is used.</p>
<p>The full set of command line options is:</p>
<dlclass="cmdoption">
<dtid="cmdoption-sip-h">
<ttclass="descname">-h</tt><ttclass="descclassname"></tt><aclass="headerlink"href="#cmdoption-sip-h"title="Permalink to this definition">¶</a></dt>
<dd>Display a help message.</dd></dl>
<dlclass="cmdoption">
<dtid="cmdoption-sip-V">
<ttclass="descname">-V</tt><ttclass="descclassname"></tt><aclass="headerlink"href="#cmdoption-sip-V"title="Permalink to this definition">¶</a></dt>
<dd>Display the SIP version number.</dd></dl>
<dlclass="cmdoption">
<dtid="cmdoption-sip-a">
<ttclass="descname">-a</tt><ttclass="descclassname"><FILE></tt><aclass="headerlink"href="#cmdoption-sip-a"title="Permalink to this definition">¶</a></dt>
component can use for auto-completion and call tips. (The file may also be
used by the SciTE editor but must be sorted first.) By default the file is
not generated.</dd></dl>
<dlclass="cmdoption">
<dtid="cmdoption-sip-b">
<ttclass="descname">-b</tt><ttclass="descclassname"><FILE></tt><aclass="headerlink"href="#cmdoption-sip-b"title="Permalink to this definition">¶</a></dt>
<dd>The name of the build file to generate. This file contains the information
about the module needed by the <aclass="reference external"href="build_system.html#ref-build-system"><em>SIP build system</em></a>
to generate a platform and compiler specific Makefile for the module. By
default the file is not generated.</dd></dl>
<dlclass="cmdoption">
<dtid="cmdoption-sip-c">
<ttclass="descname">-c</tt><ttclass="descclassname"><DIR></tt><aclass="headerlink"href="#cmdoption-sip-c"title="Permalink to this definition">¶</a></dt>
<dd>The name of the directory (which must exist) into which all of the
generated C or C++ code is placed. By default no code is generated.</dd></dl>
<dlclass="cmdoption">
<dtid="cmdoption-sip-d">
<ttclass="descname">-d</tt><ttclass="descclassname"><FILE></tt><aclass="headerlink"href="#cmdoption-sip-d"title="Permalink to this definition">¶</a></dt>
<dd>The name of the documentation file to generate. Documentation is included
in specification files using the <aclass="reference external"href="directives.html#directive-%Doc"><ttclass="xref docutils literal"><spanclass="pre">%Doc</span></tt></a> and
<aclass="reference external"href="directives.html#directive-%ExportedDoc"><ttclass="xref docutils literal"><spanclass="pre">%ExportedDoc</span></tt></a> directives. By default the file is not
generated.</dd></dl>
<dlclass="cmdoption">
<dtid="cmdoption-sip-e">
<ttclass="descname">-e</tt><ttclass="descclassname"></tt><aclass="headerlink"href="#cmdoption-sip-e"title="Permalink to this definition">¶</a></dt>
<dd>Support for C++ exceptions is enabled. This causes all calls to C++ code
to be enclosed in <ttclass="docutils literal"><spanclass="pre">try</span></tt>/<ttclass="docutils literal"><spanclass="pre">catch</span></tt> blocks and C++ exceptions to be
converted to Python exceptions. By default exception support is disabled.</dd></dl>
<dlclass="cmdoption">
<dtid="cmdoption-sip-g">
<ttclass="descname">-g</tt><ttclass="descclassname"></tt><aclass="headerlink"href="#cmdoption-sip-g"title="Permalink to this definition">¶</a></dt>
<dd>The Python GIL is released before making any calls to the C/C++ library
being wrapped and reacquired afterwards. See <aclass="reference external"href="using.html#ref-gil"><em>The Python Global Interpreter Lock</em></a> and the
<aclass="reference external"href="annotations.html#fanno-ReleaseGIL"><ttclass="xref docutils literal"><spanclass="pre">ReleaseGIL</span></tt></a> and <aclass="reference external"href="annotations.html#fanno-HoldGIL"><ttclass="xref docutils literal"><spanclass="pre">HoldGIL</span></tt></a> annotations.</dd></dl>
<dlclass="cmdoption">
<dtid="cmdoption-sip-I">
<ttclass="descname">-I</tt><ttclass="descclassname"><DIR></tt><aclass="headerlink"href="#cmdoption-sip-I"title="Permalink to this definition">¶</a></dt>
<dd>The directory is added to the list of directories searched when looking for
a specification file given in an <aclass="reference external"href="directives.html#directive-%Include"><ttclass="xref docutils literal"><spanclass="pre">%Include</span></tt></a> or
<aclass="reference external"href="directives.html#directive-%Import"><ttclass="xref docutils literal"><spanclass="pre">%Import</span></tt></a> directive. This option may be given any number of
times.</dd></dl>
<dlclass="cmdoption">
<dtid="cmdoption-sip-j">
<ttclass="descname">-j</tt><ttclass="descclassname"><NUMBER></tt><aclass="headerlink"href="#cmdoption-sip-j"title="Permalink to this definition">¶</a></dt>
<dd>The generated code is split into the given number of files. This makes it
easier to use the parallel build facility of most modern implementations of
<ttclass="docutils literal"><spanclass="pre">make</span></tt>. By default 1 file is generated for each C structure or C++
class.</dd></dl>
<dlclass="cmdoption">
<dtid="cmdoption-sip-k">
<ttclass="descname">-k</tt><ttclass="descclassname"></tt><aclass="headerlink"href="#cmdoption-sip-k"title="Permalink to this definition">¶</a></dt>
<dd><p>
<spanclass="versionmodified">New in version 4.10.</span></p>
<p>All functions and methods will, by default, support passing parameters
using the Python keyword argument syntax.</p>
</dd></dl>
<dlclass="cmdoption">
<dtid="cmdoption-sip-o">
<ttclass="descname">-o</tt><ttclass="descclassname"></tt><aclass="headerlink"href="#cmdoption-sip-o"title="Permalink to this definition">¶</a></dt>
<dd><p>
<spanclass="versionmodified">New in version 4.10.</span></p>
<p>Docstrings will be automatically generated that describe the signature of
all functions, methods and constructors.</p>
</dd></dl>
<dlclass="cmdoption">
<dtid="cmdoption-sip-p">
<ttclass="descname">-p</tt><ttclass="descclassname"><MODULE></tt><aclass="headerlink"href="#cmdoption-sip-p"title="Permalink to this definition">¶</a></dt>
<dd>The name of the <aclass="reference external"href="directives.html#directive-%ConsolidatedModule"><ttclass="xref docutils literal"><spanclass="pre">%ConsolidatedModule</span></tt></a> which will contain the
wrapper code for this component module.</dd></dl>
<dlclass="cmdoption">
<dtid="cmdoption-sip-P">
<ttclass="descname">-P</tt><ttclass="descclassname"></tt><aclass="headerlink"href="#cmdoption-sip-P"title="Permalink to this definition">¶</a></dt>
<dd><p>
<spanclass="versionmodified">New in version 4.10.</span></p>
<p>By default SIP generates code to provide access to protected C++ functions
from Python. On some platforms (notably Linux, but not Windows) this code
can be avoided if the <ttclass="docutils literal"><spanclass="pre">protected</span></tt> keyword is redefined as <ttclass="docutils literal"><spanclass="pre">public</span></tt>
during compilation. This can result in a significant reduction in the size
of a generated Python module. This option disables the generation of the
extra code.</p>
</dd></dl>
<dlclass="cmdoption">
<dtid="cmdoption-sip-r">
<ttclass="descname">-r</tt><ttclass="descclassname"></tt><aclass="headerlink"href="#cmdoption-sip-r"title="Permalink to this definition">¶</a></dt>
<dd>Debugging statements that trace the execution of the bindings are
automatically generated. By default the statements are not generated.</dd></dl>
<dlclass="cmdoption">
<dtid="cmdoption-sip-s">
<ttclass="descname">-s</tt><ttclass="descclassname"><SUFFIX></tt><aclass="headerlink"href="#cmdoption-sip-s"title="Permalink to this definition">¶</a></dt>
<dd>The suffix to use for generated C or C++ source files. By default <ttclass="docutils literal"><spanclass="pre">.c</span></tt>
is used for C and <ttclass="docutils literal"><spanclass="pre">.cpp</span></tt> for C++.</dd></dl>
<dlclass="cmdoption">
<dtid="cmdoption-sip-t">
<ttclass="descname">-t</tt><ttclass="descclassname"><TAG></tt><aclass="headerlink"href="#cmdoption-sip-t"title="Permalink to this definition">¶</a></dt>
<dd>The SIP version tag (declared using a <aclass="reference external"href="directives.html#directive-%Timeline"><ttclass="xref docutils literal"><spanclass="pre">%Timeline</span></tt></a> directive) or
the SIP platform tag (declared using the <aclass="reference external"href="directives.html#directive-%Platforms"><ttclass="xref docutils literal"><spanclass="pre">%Platforms</span></tt></a> directive)
to generate code for. This option may be given any number of times so long
as the tags do not conflict.</dd></dl>
<dlclass="cmdoption">
<dtid="cmdoption-sip-w">
<ttclass="descname">-w</tt><ttclass="descclassname"></tt><aclass="headerlink"href="#cmdoption-sip-w"title="Permalink to this definition">¶</a></dt>
<dd>The display of warning messages is enabled. By default warning messages
are disabled.</dd></dl>
<dlclass="cmdoption">
<dtid="cmdoption-sip-x">
<ttclass="descname">-x</tt><ttclass="descclassname"><FEATURE></tt><aclass="headerlink"href="#cmdoption-sip-x"title="Permalink to this definition">¶</a></dt>
<dd>The feature (declared using the <aclass="reference external"href="directives.html#directive-%Feature"><ttclass="xref docutils literal"><spanclass="pre">%Feature</span></tt></a> directive) is
disabled.</dd></dl>
<dlclass="cmdoption">
<dtid="cmdoption-sip-z">
<ttclass="descname">-z</tt><ttclass="descclassname"><FILE></tt><aclass="headerlink"href="#cmdoption-sip-z"title="Permalink to this definition">¶</a></dt>
<dd>The name of a file containing more command line options.</dd></dl>