fork/cargo

git clone https://git.julia.blue/fork/cargo

borsAuto merge of #14424 - Ifropc:lockfile-tracking-issue, r=weihanglo88957a1b7

0.87.0
6.8 KiB176 linesraw
1CARGO-REMOVE(1)
2
3NAME
4       cargo-remove — Remove dependencies from a Cargo.toml manifest file
5
6SYNOPSIS
7       cargo remove [options] dependency…
8
9DESCRIPTION
10       Remove one or more dependencies from a Cargo.toml manifest.
11
12OPTIONS
13   Section options
14       --dev
15           Remove as a development dependency
16           <https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#development-dependencies>.
17
18       --build
19           Remove as a build dependency
20           <https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#build-dependencies>.
21
22       --target target
23           Remove as a dependency to the given target platform
24           <https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#platform-specific-dependencies>.
25
26           To avoid unexpected shell expansions, you may use quotes around each
27           target, e.g., --target 'cfg(unix)'.
28
29   Miscellaneous Options
30       --dry-run
31           Don’t actually write to the manifest.
32
33   Display Options
34       -v, --verbose
35           Use verbose output. May be specified twice for “very verbose”
36           output which includes extra output such as dependency warnings and
37           build script output. May also be specified with the term.verbose
38           config value
39           <https://doc.rust-lang.org/cargo/reference/config.html>.
40
41       -q, --quiet
42           Do not print cargo log messages. May also be specified with the
43           term.quiet config value
44           <https://doc.rust-lang.org/cargo/reference/config.html>.
45
46       --color when
47           Control when colored output is used. Valid values:
48
49           o  auto (default): Automatically detect if color support is
50              available on the terminal.
51
52           o  always: Always display colors.
53
54           o  never: Never display colors.
55
56           May also be specified with the term.color config value
57           <https://doc.rust-lang.org/cargo/reference/config.html>.
58
59   Manifest Options
60       --manifest-path path
61           Path to the Cargo.toml file. By default, Cargo searches for the
62           Cargo.toml file in the current directory or any parent directory.
63
64       --locked
65           Asserts that the exact same dependencies and versions are used as
66           when the existing Cargo.lock file was originally generated. Cargo
67           will exit with an error when either of the following scenarios
68           arises:
69
70           o  The lock file is missing.
71
72           o  Cargo attempted to change the lock file due to a different
73              dependency resolution.
74
75           It may be used in environments where deterministic builds are
76           desired, such as in CI pipelines.
77
78       --offline
79           Prevents Cargo from accessing the network for any reason. Without
80           this flag, Cargo will stop with an error if it needs to access the
81           network and the network is not available. With this flag, Cargo will
82           attempt to proceed without the network if possible.
83
84           Beware that this may result in different dependency resolution than
85           online mode. Cargo will restrict itself to crates that are
86           downloaded locally, even if there might be a newer version as
87           indicated in the local copy of the index. See the cargo-fetch(1)
88           command to download dependencies before going offline.
89
90           May also be specified with the net.offline config value
91           <https://doc.rust-lang.org/cargo/reference/config.html>.
92
93       --frozen
94           Equivalent to specifying both --locked and --offline.
95
96       --lockfile-path PATH
97           Changes the path of the lockfile from the default
98           (<workspace_root>/Cargo.lock) to PATH. PATH must end with Cargo.lock
99           (e.g. --lockfile-path /tmp/temporary-lockfile/Cargo.lock). Note that
100           providing --lockfile-path will ignore existing lockfile at the
101           default path, and instead will either use the lockfile from PATH, or
102           write a new lockfile into the provided PATH if it doesn’t exist.
103           This flag can be used to run most commands in read-only directories,
104           writing lockfile into the provided PATH.
105
106           This option is only available on the nightly channel
107           <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html> and
108           requires the -Z unstable-options flag to enable (see #14421
109           <https://github.com/rust-lang/cargo/issues/14421>).
110
111   Package Selection
112       -p spec…, --package spec…
113           Package to remove from.
114
115   Common Options
116       +toolchain
117           If Cargo has been installed with rustup, and the first argument to
118           cargo begins with +, it will be interpreted as a rustup toolchain
119           name (such as +stable or +nightly). See the rustup documentation
120           <https://rust-lang.github.io/rustup/overrides.html> for more
121           information about how toolchain overrides work.
122
123       --config KEY=VALUE or PATH
124           Overrides a Cargo configuration value. The argument should be in
125           TOML syntax of KEY=VALUE, or provided as a path to an extra
126           configuration file. This flag may be specified multiple times. See
127           the command-line overrides section
128           <https://doc.rust-lang.org/cargo/reference/config.html#command-line-overrides>
129           for more information.
130
131       -C PATH
132           Changes the current working directory before executing any specified
133           operations. This affects things like where cargo looks by default
134           for the project manifest (Cargo.toml), as well as the directories
135           searched for discovering .cargo/config.toml, for example. This
136           option must appear before the command name, for example cargo -C
137           path/to/my-project build.
138
139           This option is only available on the nightly channel
140           <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html> and
141           requires the -Z unstable-options flag to enable (see #10098
142           <https://github.com/rust-lang/cargo/issues/10098>).
143
144       -h, --help
145           Prints help information.
146
147       -Z flag
148           Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
149           details.
150
151ENVIRONMENT
152       See the reference
153       <https://doc.rust-lang.org/cargo/reference/environment-variables.html>
154       for details on environment variables that Cargo reads.
155
156EXIT STATUS
157       o  0: Cargo succeeded.
158
159       o  101: Cargo failed to complete.
160
161EXAMPLES
162       1. Remove regex as a dependency
163
164              cargo remove regex
165
166       2. Remove trybuild as a dev-dependency
167
168              cargo remove --dev trybuild
169
170       3. Remove nom from the x86_64-pc-windows-gnu dependencies table
171
172              cargo remove --target x86_64-pc-windows-gnu nom
173
174SEE ALSO
175       cargo(1), cargo-add(1)
176