<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>src/doc/man/includes/options-targets.md - fork/cargo @ 0.92.0</title>
<meta name="description" content="src/doc/man/includes/options-targets.md in fork/cargo at 0.92.0.">
<meta property="og:title" content="src/doc/man/includes/options-targets.md - fork/cargo @ 0.92.0">
<meta property="og:description" content="src/doc/man/includes/options-targets.md in fork/cargo at 0.92.0.">
<meta property="og:type" content="website">
<meta property="og:site_name" content="git.julia.blue">
<link rel="stylesheet" href="/css/style.css?v=62">
<script type="module" src="/js/main.js?v=62"></script>
</head>
<body>
<main data-ref="0.92.0" data-tip="ea2d97820c16195b0ca3fadb4319fe512c199a43">
<noscript>
  <div class="callout">
    <p>
      hey! this is a static git repo viewer. commit diffs, file history,
      older commits and other revisions won't load without javascript.
    </p>
    <p>
      you are still able to view source files on branch/tag tips,
      but the experience is degraded.
    </p>
  </div>
</noscript>
<header class="repo"><div>
<h1>fork/cargo</h1>
</div>
<pre class="clone">git clone https://git.julia.blue/fork/cargo</pre>
</header>
<p class="snapshot-commit"><span class="commit-author">bors</span><span class="commit-message" data-commit="de128bea79f3ed01a518adadffbb2ca86534c0c7">Auto merge of #14675 - RalfJung:help, r=weihanglo</span><span class="snapshot-sha sha" data-commit="de128bea79f3ed01a518adadffbb2ca86534c0c7">de128bea7</span><time datetime="2024-10-12T16:40:40+00:00" title="2024-10-12 16:40:40 +0000">2024-10-12</time></p>
<header class="topbar"><details class="switcher"><summary>0.92.0</summary><div class="menu"><strong>branches</strong><a href="/fork/cargo/ref/master/">master</a><strong>tags</strong><a href="/fork/cargo/ref/0.87.0/">0.87.0</a><a href="/fork/cargo/ref/0.88.0/">0.88.0</a><a href="/fork/cargo/ref/0.89.0/">0.89.0</a><a href="/fork/cargo/ref/0.90.0/">0.90.0</a><a href="/fork/cargo/ref/0.91.0/">0.91.0</a><a class="current" href="/fork/cargo/ref/0.92.0/">0.92.0</a><a href="/fork/cargo/ref/0.93.0/">0.93.0</a><a href="/fork/cargo/ref/home-0.5.12/">home-0.5.12</a><a class="all" href="/fork/cargo/refs">all refs →</a></div></details><nav class="crumbs"><a href="/fork/cargo/">cargo</a> / <a href="/fork/cargo/ref/0.92.0/tree/src/">src</a> / <a href="/fork/cargo/ref/0.92.0/tree/src/doc/">doc</a> / <a href="/fork/cargo/ref/0.92.0/tree/src/doc/man/">man</a> / <a href="/fork/cargo/ref/0.92.0/tree/src/doc/man/includes/">includes</a> / <span class="cur">options-targets.md</span></nav>
<span class="view-stats"><span>2.1 KiB</span><span>57 lines</span></span><span class="actions"><a class="raw" href="/fork/cargo/raw/a2e26b1a2e95fe6c7e74ebd362e40528dcb4f2f6/src/doc/man/includes/options-targets.md">raw</a></span></header>
<div class="markdown-view"><input type="radio" name="markdown-view" id="markdown-rendered" checked><label for="markdown-rendered">rendered</label><input type="radio" name="markdown-view" id="markdown-code"><label for="markdown-code">code</label><section class="readme rendered"><p>Passing target selection flags will {{lower actionverb}} only the specified
targets.</p>
<p>Note that <code>--bin</code>, <code>--example</code>, <code>--test</code> and <code>--bench</code> flags also
support common Unix glob patterns like <code>*</code>, <code>?</code> and <code>[]</code>. However, to avoid your
shell accidentally expanding glob patterns before Cargo handles them, you must
use single quotes or double quotes around each glob pattern.</p>
<p>{{#options}}</p>
<p>{{&gt; options-targets-lib-bin }}</p>
<p>{{#option "<code>--example</code> <em>name</em>..." }}
{{actionverb}} the specified example. This flag may be specified multiple times
and supports common Unix glob patterns.
{{/option}}</p>
<p>{{#option "<code>--examples</code>" }}
{{actionverb}} all example targets.
{{/option}}</p>
<p>{{#option "<code>--test</code> <em>name</em>..." }}
{{actionverb}} the specified integration test. This flag may be specified
multiple times and supports common Unix glob patterns.
{{/option}}</p>
<p>{{#option "<code>--tests</code>" }}
{{actionverb}} all targets that have the <code>test = true</code> manifest
flag set. By default this includes the library and binaries built as
unittests, and integration tests. Be aware that this will also build any
required dependencies, so the lib target may be built twice (once as a
unittest, and once as a dependency for binaries, integration tests, etc.).
Targets may be enabled or disabled by setting the <code>test</code> flag in the
manifest settings for the target.
{{/option}}</p>
<p>{{#option "<code>--bench</code> <em>name</em>..." }}
{{actionverb}} the specified benchmark. This flag may be specified multiple
times and supports common Unix glob patterns.
{{/option}}</p>
<p>{{#option "<code>--benches</code>" }}
{{actionverb}} all targets that have the <code>bench = true</code>
manifest flag set. By default this includes the library and binaries built
as benchmarks, and bench targets. Be aware that this will also build any
required dependencies, so the lib target may be built twice (once as a
benchmark, and once as a dependency for binaries, benchmarks, etc.).
Targets may be enabled or disabled by setting the <code>bench</code> flag in the
manifest settings for the target.
{{/option}}</p>
<p>{{#option "<code>--all-targets</code>" }}
{{actionverb}} all targets. This is equivalent to specifying <code>--lib --bins --tests --benches --examples</code>.
{{/option}}</p>
<p>{{/options}}</p>
</section><div class="code-panel"><pre class="code src language-markdown"><span class="code-line"><a class="ln" id="L1" href="#L1">1</a><span class="code-text">Passing target selection flags will {{lower actionverb}} only the specified</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L2" href="#L2">2</a><span class="code-text">targets. </span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L3" href="#L3">3</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text">Note that `--bin`, `--example`, `--test` and `--bench` flags also </span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L5" href="#L5">5</a><span class="code-text">support common Unix glob patterns like `*`, `?` and `[]`. However, to avoid your </span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L6" href="#L6">6</a><span class="code-text">shell accidentally expanding glob patterns before Cargo handles them, you must </span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text">use single quotes or double quotes around each glob pattern.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L9" href="#L9">9</a><span class="code-text">{{#options}}</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L10" href="#L10">10</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L11" href="#L11">11</a><span class="code-text">{{&gt; options-targets-lib-bin }}</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L12" href="#L12">12</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L13" href="#L13">13</a><span class="code-text">{{#option &quot;`--example` _name_...&quot; }}</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L14" href="#L14">14</a><span class="code-text">{{actionverb}} the specified example. This flag may be specified multiple times</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L15" href="#L15">15</a><span class="code-text">and supports common Unix glob patterns.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L16" href="#L16">16</a><span class="code-text">{{/option}}</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L17" href="#L17">17</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L18" href="#L18">18</a><span class="code-text">{{#option &quot;`--examples`&quot; }}</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L19" href="#L19">19</a><span class="code-text">{{actionverb}} all example targets.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L20" href="#L20">20</a><span class="code-text">{{/option}}</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L21" href="#L21">21</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L22" href="#L22">22</a><span class="code-text">{{#option &quot;`--test` _name_...&quot; }}</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L23" href="#L23">23</a><span class="code-text">{{actionverb}} the specified integration test. This flag may be specified</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L24" href="#L24">24</a><span class="code-text">multiple times and supports common Unix glob patterns.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L25" href="#L25">25</a><span class="code-text">{{/option}}</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L26" href="#L26">26</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L27" href="#L27">27</a><span class="code-text">{{#option &quot;`--tests`&quot; }}</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L28" href="#L28">28</a><span class="code-text">{{actionverb}} all targets that have the `test = true` manifest</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L29" href="#L29">29</a><span class="code-text">flag set. By default this includes the library and binaries built as</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L30" href="#L30">30</a><span class="code-text">unittests, and integration tests. Be aware that this will also build any</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L31" href="#L31">31</a><span class="code-text">required dependencies, so the lib target may be built twice (once as a</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L32" href="#L32">32</a><span class="code-text">unittest, and once as a dependency for binaries, integration tests, etc.).</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L33" href="#L33">33</a><span class="code-text">Targets may be enabled or disabled by setting the `test` flag in the</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L34" href="#L34">34</a><span class="code-text">manifest settings for the target.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L35" href="#L35">35</a><span class="code-text">{{/option}}</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L36" href="#L36">36</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L37" href="#L37">37</a><span class="code-text">{{#option &quot;`--bench` _name_...&quot; }}</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L38" href="#L38">38</a><span class="code-text">{{actionverb}} the specified benchmark. This flag may be specified multiple</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L39" href="#L39">39</a><span class="code-text">times and supports common Unix glob patterns.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L40" href="#L40">40</a><span class="code-text">{{/option}}</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L41" href="#L41">41</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L42" href="#L42">42</a><span class="code-text">{{#option &quot;`--benches`&quot; }}</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L43" href="#L43">43</a><span class="code-text">{{actionverb}} all targets that have the `bench = true`</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L44" href="#L44">44</a><span class="code-text">manifest flag set. By default this includes the library and binaries built</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L45" href="#L45">45</a><span class="code-text">as benchmarks, and bench targets. Be aware that this will also build any</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L46" href="#L46">46</a><span class="code-text">required dependencies, so the lib target may be built twice (once as a</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L47" href="#L47">47</a><span class="code-text">benchmark, and once as a dependency for binaries, benchmarks, etc.).</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L48" href="#L48">48</a><span class="code-text">Targets may be enabled or disabled by setting the `bench` flag in the</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L49" href="#L49">49</a><span class="code-text">manifest settings for the target.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L50" href="#L50">50</a><span class="code-text">{{/option}}</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L51" href="#L51">51</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L52" href="#L52">52</a><span class="code-text">{{#option &quot;`--all-targets`&quot; }}</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L53" href="#L53">53</a><span class="code-text">{{actionverb}} all targets. This is equivalent to specifying `--lib --bins</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L54" href="#L54">54</a><span class="code-text">--tests --benches --examples`.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L55" href="#L55">55</a><span class="code-text">{{/option}}</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L56" href="#L56">56</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L57" href="#L57">57</a><span class="code-text">{{/options}}</span></span></pre></div></div>
</main>
</body>
</html>
