]> git.proxmox.com Git - rustc.git/blob - src/tools/cargo/src/doc/src/commands/cargo-yank.md
New upstream version 1.70.0+dfsg2
[rustc.git] / src / tools / cargo / src / doc / src / commands / cargo-yank.md
1 # cargo-yank(1)
2
3 ## NAME
4
5 cargo-yank --- Remove a pushed crate from the index
6
7 ## SYNOPSIS
8
9 `cargo yank` [_options_] _crate_@_version_\
10 `cargo yank` [_options_] `--version` _version_ [_crate_]
11
12 ## DESCRIPTION
13
14 The yank command removes a previously published crate's version from the
15 server's index. This command does not delete any data, and the crate will
16 still be available for download via the registry's download link.
17
18 Note that existing crates locked to a yanked version will still be able to
19 download the yanked version to use it. Cargo will, however, not allow any new
20 crates to be locked to any yanked version.
21
22 This command requires you to be authenticated with either the `--token` option
23 or using [cargo-login(1)](cargo-login.html).
24
25 If the crate name is not specified, it will use the package name from the
26 current directory.
27
28 ## OPTIONS
29
30 ### Yank Options
31
32 <dl>
33
34 <dt class="option-term" id="option-cargo-yank---vers"><a class="option-anchor" href="#option-cargo-yank---vers"></a><code>--vers</code> <em>version</em></dt>
35 <dt class="option-term" id="option-cargo-yank---version"><a class="option-anchor" href="#option-cargo-yank---version"></a><code>--version</code> <em>version</em></dt>
36 <dd class="option-desc">The version to yank or un-yank.</dd>
37
38
39 <dt class="option-term" id="option-cargo-yank---undo"><a class="option-anchor" href="#option-cargo-yank---undo"></a><code>--undo</code></dt>
40 <dd class="option-desc">Undo a yank, putting a version back into the index.</dd>
41
42
43 <dt class="option-term" id="option-cargo-yank---token"><a class="option-anchor" href="#option-cargo-yank---token"></a><code>--token</code> <em>token</em></dt>
44 <dd class="option-desc">API token to use when authenticating. This overrides the token stored in
45 the credentials file (which is created by <a href="cargo-login.html">cargo-login(1)</a>).</p>
46 <p><a href="../reference/config.html">Cargo config</a> environment variables can be
47 used to override the tokens stored in the credentials file. The token for
48 crates.io may be specified with the <code>CARGO_REGISTRY_TOKEN</code> environment
49 variable. Tokens for other registries may be specified with environment
50 variables of the form <code>CARGO_REGISTRIES_NAME_TOKEN</code> where <code>NAME</code> is the name
51 of the registry in all capital letters.</dd>
52
53
54
55 <dt class="option-term" id="option-cargo-yank---index"><a class="option-anchor" href="#option-cargo-yank---index"></a><code>--index</code> <em>index</em></dt>
56 <dd class="option-desc">The URL of the registry index to use.</dd>
57
58
59
60 <dt class="option-term" id="option-cargo-yank---registry"><a class="option-anchor" href="#option-cargo-yank---registry"></a><code>--registry</code> <em>registry</em></dt>
61 <dd class="option-desc">Name of the registry to use. Registry names are defined in <a href="../reference/config.html">Cargo config
62 files</a>. If not specified, the default registry is used,
63 which is defined by the <code>registry.default</code> config key which defaults to
64 <code>crates-io</code>.</dd>
65
66
67
68 </dl>
69
70 ### Display Options
71
72 <dl>
73
74 <dt class="option-term" id="option-cargo-yank--v"><a class="option-anchor" href="#option-cargo-yank--v"></a><code>-v</code></dt>
75 <dt class="option-term" id="option-cargo-yank---verbose"><a class="option-anchor" href="#option-cargo-yank---verbose"></a><code>--verbose</code></dt>
76 <dd class="option-desc">Use verbose output. May be specified twice for “very verbose” output which
77 includes extra output such as dependency warnings and build script output.
78 May also be specified with the <code>term.verbose</code>
79 <a href="../reference/config.html">config value</a>.</dd>
80
81
82 <dt class="option-term" id="option-cargo-yank--q"><a class="option-anchor" href="#option-cargo-yank--q"></a><code>-q</code></dt>
83 <dt class="option-term" id="option-cargo-yank---quiet"><a class="option-anchor" href="#option-cargo-yank---quiet"></a><code>--quiet</code></dt>
84 <dd class="option-desc">Do not print cargo log messages.
85 May also be specified with the <code>term.quiet</code>
86 <a href="../reference/config.html">config value</a>.</dd>
87
88
89 <dt class="option-term" id="option-cargo-yank---color"><a class="option-anchor" href="#option-cargo-yank---color"></a><code>--color</code> <em>when</em></dt>
90 <dd class="option-desc">Control when colored output is used. Valid values:</p>
91 <ul>
92 <li><code>auto</code> (default): Automatically detect if color support is available on the
93 terminal.</li>
94 <li><code>always</code>: Always display colors.</li>
95 <li><code>never</code>: Never display colors.</li>
96 </ul>
97 <p>May also be specified with the <code>term.color</code>
98 <a href="../reference/config.html">config value</a>.</dd>
99
100
101
102 </dl>
103
104 ### Common Options
105
106 <dl>
107
108 <dt class="option-term" id="option-cargo-yank-+toolchain"><a class="option-anchor" href="#option-cargo-yank-+toolchain"></a><code>+</code><em>toolchain</em></dt>
109 <dd class="option-desc">If Cargo has been installed with rustup, and the first argument to <code>cargo</code>
110 begins with <code>+</code>, it will be interpreted as a rustup toolchain name (such
111 as <code>+stable</code> or <code>+nightly</code>).
112 See the <a href="https://rust-lang.github.io/rustup/overrides.html">rustup documentation</a>
113 for more information about how toolchain overrides work.</dd>
114
115
116 <dt class="option-term" id="option-cargo-yank---config"><a class="option-anchor" href="#option-cargo-yank---config"></a><code>--config</code> <em>KEY=VALUE</em> or <em>PATH</em></dt>
117 <dd class="option-desc">Overrides a Cargo configuration value. The argument should be in TOML syntax of <code>KEY=VALUE</code>,
118 or provided as a path to an extra configuration file. This flag may be specified multiple times.
119 See the <a href="../reference/config.html#command-line-overrides">command-line overrides section</a> for more information.</dd>
120
121
122 <dt class="option-term" id="option-cargo-yank--C"><a class="option-anchor" href="#option-cargo-yank--C"></a><code>-C</code> <em>PATH</em></dt>
123 <dd class="option-desc">Changes the current working directory before executing any specified operations. This affects
124 things like where cargo looks by default for the project manifest (<code>Cargo.toml</code>), as well as
125 the directories searched for discovering <code>.cargo/config.toml</code>, for example. This option must
126 appear before the command name, for example <code>cargo -C path/to/my-project build</code>.</p>
127 <p>This option is only available on the <a href="https://doc.rust-lang.org/book/appendix-07-nightly-rust.html">nightly
128 channel</a> and
129 requires the <code>-Z unstable-options</code> flag to enable (see
130 <a href="https://github.com/rust-lang/cargo/issues/10098">#10098</a>).</dd>
131
132
133 <dt class="option-term" id="option-cargo-yank--h"><a class="option-anchor" href="#option-cargo-yank--h"></a><code>-h</code></dt>
134 <dt class="option-term" id="option-cargo-yank---help"><a class="option-anchor" href="#option-cargo-yank---help"></a><code>--help</code></dt>
135 <dd class="option-desc">Prints help information.</dd>
136
137
138 <dt class="option-term" id="option-cargo-yank--Z"><a class="option-anchor" href="#option-cargo-yank--Z"></a><code>-Z</code> <em>flag</em></dt>
139 <dd class="option-desc">Unstable (nightly-only) flags to Cargo. Run <code>cargo -Z help</code> for details.</dd>
140
141
142 </dl>
143
144
145 ## ENVIRONMENT
146
147 See [the reference](../reference/environment-variables.html) for
148 details on environment variables that Cargo reads.
149
150
151 ## EXIT STATUS
152
153 * `0`: Cargo succeeded.
154 * `101`: Cargo failed to complete.
155
156
157 ## EXAMPLES
158
159 1. Yank a crate from the index:
160
161 cargo yank foo@1.0.7
162
163 ## SEE ALSO
164 [cargo(1)](cargo.html), [cargo-login(1)](cargo-login.html), [cargo-publish(1)](cargo-publish.html)