blob: 4e1d00965e8c4d21c52d89b0c6e63e6e56945576 [file] [log] [blame]
<h2 id="cargo_yank_name">NAME</h2>
<div class="sectionbody">
<p>cargo-yank - Remove a pushed crate from the index</p>
</div>
<div class="sect1">
<h2 id="cargo_yank_synopsis">SYNOPSIS</h2>
<div class="sectionbody">
<div class="paragraph">
<p><code>cargo yank [<em>OPTIONS</em>] --vers <em>VERSION</em> [<em>CRATE</em>]</code></p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="cargo_yank_description">DESCRIPTION</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The yank command removes a previously published crate&#8217;s version from the
server&#8217;s index. This command does not delete any data, and the crate will
still be available for download via the registry&#8217;s download link.</p>
</div>
<div class="paragraph">
<p>Note that existing crates locked to a yanked version will still be able to
download the yanked version to use it. Cargo will, however, not allow any new
crates to be locked to any yanked version.</p>
</div>
<div class="paragraph">
<p>This command requires you to be authenticated with either the <code>--token</code> option
or using <a href="commands/cargo-login.html">cargo-login(1)</a>.</p>
</div>
<div class="paragraph">
<p>If the crate name is not specified, it will use the package name from the
current directory.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="cargo_yank_options">OPTIONS</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="cargo_yank_owner_options">Owner Options</h3>
<div class="dlist">
<dl>
<dt class="hdlist1"><strong>--vers</strong> <em>VERSION</em></dt>
<dd>
<p>The version to yank or un-yank.</p>
</dd>
<dt class="hdlist1"><strong>--undo</strong></dt>
<dd>
<p>Undo a yank, putting a version back into the index.</p>
</dd>
<dt class="hdlist1"><strong>--token</strong> <em>TOKEN</em></dt>
<dd>
<p>API token to use when authenticating. This overrides the token stored in
the credentials file (which is created by <a href="commands/cargo-login.html">cargo-login(1)</a>).</p>
<div class="paragraph">
<p><a href="reference/config.html">Cargo config</a> environment variables can be
used to override the tokens stored in the credentials file. The token for
crates.io may be specified with the <code>CARGO_REGISTRY_TOKEN</code> environment
variable. Tokens for other registries may be specified with environment
variables of the form <code>CARGO_REGISTRIES_NAME_TOKEN</code> where <code>NAME</code> is the name
of the registry in all capital letters.</p>
</div>
</dd>
<dt class="hdlist1"><strong>--index</strong> <em>INDEX</em></dt>
<dd>
<p>The URL of the registry index to use.</p>
</dd>
<dt class="hdlist1"><strong>--registry</strong> <em>REGISTRY</em></dt>
<dd>
<p>Name of the registry to use. Registry names are defined in <a href="reference/config.html">Cargo config files</a>.
If not specified, the default registry is used, which is defined by the
<code>registry.default</code> config key which defaults to <code>crates-io</code>.</p>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="cargo_yank_display_options">Display Options</h3>
<div class="dlist">
<dl>
<dt class="hdlist1"><strong>-v</strong></dt>
<dt class="hdlist1"><strong>--verbose</strong></dt>
<dd>
<p>Use verbose output. May be specified twice for "very verbose" output which
includes extra output such as dependency warnings and build script output.
May also be specified with the <code>term.verbose</code>
<a href="reference/config.html">config value</a>.</p>
</dd>
<dt class="hdlist1"><strong>-q</strong></dt>
<dt class="hdlist1"><strong>--quiet</strong></dt>
<dd>
<p>No output printed to stdout.</p>
</dd>
<dt class="hdlist1"><strong>--color</strong> <em>WHEN</em></dt>
<dd>
<p>Control when colored output is used. Valid values:</p>
<div class="ulist">
<ul>
<li>
<p><code>auto</code> (default): Automatically detect if color support is available on the
terminal.</p>
</li>
<li>
<p><code>always</code>: Always display colors.</p>
</li>
<li>
<p><code>never</code>: Never display colors.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>May also be specified with the <code>term.color</code>
<a href="reference/config.html">config value</a>.</p>
</div>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="cargo_yank_common_options">Common Options</h3>
<div class="dlist">
<dl>
<dt class="hdlist1"><strong>-h</strong></dt>
<dt class="hdlist1"><strong>--help</strong></dt>
<dd>
<p>Prints help information.</p>
</dd>
<dt class="hdlist1"><strong>-Z</strong> <em>FLAG</em>&#8230;&#8203;</dt>
<dd>
<p>Unstable (nightly-only) flags to Cargo. Run <code>cargo -Z help</code> for
details.</p>
</dd>
</dl>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="cargo_yank_environment">ENVIRONMENT</h2>
<div class="sectionbody">
<div class="paragraph">
<p>See <a href="reference/environment-variables.html">the reference</a> for
details on environment variables that Cargo reads.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="cargo_yank_exit_status">Exit Status</h2>
<div class="sectionbody">
<div class="dlist">
<dl>
<dt class="hdlist1">0</dt>
<dd>
<p>Cargo succeeded.</p>
</dd>
<dt class="hdlist1">101</dt>
<dd>
<p>Cargo failed to complete.</p>
</dd>
</dl>
</div>
</div>
</div>
<div class="sect1">
<h2 id="cargo_yank_examples">EXAMPLES</h2>
<div class="sectionbody">
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Yank a crate from the index:</p>
<div class="literalblock">
<div class="content">
<pre>cargo yank --vers 1.0.7 foo</pre>
</div>
</div>
</li>
</ol>
</div>
</div>
</div>
<div class="sect1">
<h2 id="cargo_yank_see_also">SEE ALSO</h2>
<div class="sectionbody">
<div class="paragraph">
<p><a href="commands/index.html">cargo(1)</a>, <a href="commands/cargo-login.html">cargo-login(1)</a>, <a href="commands/cargo-publish.html">cargo-publish(1)</a></p>
</div>
</div>
</div>