1CARGO-REMOVE(1)             General Commands Manual            CARGO-REMOVE(1)
2
3
4

NAME

6       cargo-remove - Remove dependencies from a Cargo.toml manifest file
7

SYNOPSIS

9       cargo remove [options] dependency...
10

DESCRIPTION

12       Remove one or more dependencies from a Cargo.toml manifest.
13

OPTIONS

15   Section options
16       --dev
17           Remove as a development dependency
18           <https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#development-dependencies>.
19
20       --build
21           Remove as a build dependency
22           <https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#build-dependencies>.
23
24       --target target
25           Remove as a dependency to the given target platform
26           <https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#platform-specific-dependencies>.
27
28   Miscellaneous Options
29       --dry-run
30           Don't actually write to the manifest.
31
32   Display Options
33       -v, --verbose
34           Use verbose output. May be specified twice for "very verbose"
35           output which includes extra output such as dependency warnings and
36           build script output. May also be specified with the term.verbose
37           config value
38           <https://doc.rust-lang.org/cargo/reference/config.html>.
39
40       -q, --quiet
41           Do not print cargo log messages. May also be specified with the
42           term.quiet config value
43           <https://doc.rust-lang.org/cargo/reference/config.html>.
44
45       --color when
46           Control when colored output is used. Valid values:
47
48auto (default): Automatically detect if color support is
49               available on the terminal.
50
51always: Always display colors.
52
53never: Never display colors.
54
55           May also be specified with the term.color config value
56           <https://doc.rust-lang.org/cargo/reference/config.html>.
57
58   Manifest Options
59       --manifest-path path
60           Path to the Cargo.toml file. By default, Cargo searches for the
61           Cargo.toml file in the current directory or any parent directory.
62
63       --frozen, --locked
64           Either of these flags requires that the Cargo.lock file is
65           up-to-date. If the lock file is missing, or it needs to be updated,
66           Cargo will exit with an error. The --frozen flag also prevents
67           Cargo from attempting to access the network to determine if it is
68           out-of-date.
69
70           These may be used in environments where you want to assert that the
71           Cargo.lock file is up-to-date (such as a CI build) or want to avoid
72           network access.
73
74       --offline
75           Prevents Cargo from accessing the network for any reason. Without
76           this flag, Cargo will stop with an error if it needs to access the
77           network and the network is not available. With this flag, Cargo
78           will attempt to proceed without the network if possible.
79
80           Beware that this may result in different dependency resolution than
81           online mode. Cargo will restrict itself to crates that are
82           downloaded locally, even if there might be a newer version as
83           indicated in the local copy of the index. See the cargo-fetch(1)
84           command to download dependencies before going offline.
85
86           May also be specified with the net.offline config value
87           <https://doc.rust-lang.org/cargo/reference/config.html>.
88
89   Package Selection
90       -p spec..., --package spec...
91           Package to remove from.
92
93   Common Options
94       +toolchain
95           If Cargo has been installed with rustup, and the first argument to
96           cargo begins with +, it will be interpreted as a rustup toolchain
97           name (such as +stable or +nightly). See the rustup documentation
98           <https://rust-lang.github.io/rustup/overrides.html> for more
99           information about how toolchain overrides work.
100
101       --config KEY=VALUE or PATH
102           Overrides a Cargo configuration value. The argument should be in
103           TOML syntax of KEY=VALUE, or provided as a path to an extra
104           configuration file. This flag may be specified multiple times. See
105           the command-line overrides section
106           <https://doc.rust-lang.org/cargo/reference/config.html#command-line-overrides>
107           for more information.
108
109       -h, --help
110           Prints help information.
111
112       -Z flag
113           Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
114           details.
115

ENVIRONMENT

117       See the reference
118       <https://doc.rust-lang.org/cargo/reference/environment-variables.html>
119       for details on environment variables that Cargo reads.
120

EXIT STATUS

1220: Cargo succeeded.
123
124101: Cargo failed to complete.
125

EXAMPLES

127        1. Remove regex as a dependency
128
129               cargo remove regex
130
131        2. Remove trybuild as a dev-dependency
132
133               cargo remove --dev trybuild
134
135        3. Remove nom from the x86_64-pc-windows-gnu dependencies table
136
137               cargo remove --target x86_64-pc-windows-gnu nom
138

SEE ALSO

140       cargo(1), cargo-add(1)
141
142
143
144                                                               CARGO-REMOVE(1)
Impressum