|
| 1 | +CARGO-REMOVE(1) |
| 2 | + |
| 3 | +NAME |
| 4 | + cargo-remove - Remove dependencies from a Cargo.toml manifest file |
| 5 | + |
| 6 | +SYNOPSIS |
| 7 | + cargo remove [options] dependency... |
| 8 | + |
| 9 | +DESCRIPTION |
| 10 | + Remove one or more dependencies from a Cargo.toml manifest. |
| 11 | + |
| 12 | +OPTIONS |
| 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 | + Miscellaneous Options |
| 27 | + --dry-run |
| 28 | + Don't actually write to the manifest. |
| 29 | + |
| 30 | + Display Options |
| 31 | + -v, --verbose |
| 32 | + Use verbose output. May be specified twice for "very verbose" output |
| 33 | + which includes extra output such as dependency warnings and build |
| 34 | + script output. May also be specified with the term.verbose config |
| 35 | + value <https://doc.rust-lang.org/cargo/reference/config.html>. |
| 36 | + |
| 37 | + -q, --quiet |
| 38 | + Do not print cargo log messages. May also be specified with the |
| 39 | + term.quiet config value |
| 40 | + <https://doc.rust-lang.org/cargo/reference/config.html>. |
| 41 | + |
| 42 | + --color when |
| 43 | + Control when colored output is used. Valid values: |
| 44 | + |
| 45 | + o auto (default): Automatically detect if color support is |
| 46 | + available on the terminal. |
| 47 | + |
| 48 | + o always: Always display colors. |
| 49 | + |
| 50 | + o never: Never display colors. |
| 51 | + |
| 52 | + May also be specified with the term.color config value |
| 53 | + <https://doc.rust-lang.org/cargo/reference/config.html>. |
| 54 | + |
| 55 | + Manifest Options |
| 56 | + --manifest-path path |
| 57 | + Path to the Cargo.toml file. By default, Cargo searches for the |
| 58 | + Cargo.toml file in the current directory or any parent directory. |
| 59 | + |
| 60 | + --frozen, --locked |
| 61 | + Either of these flags requires that the Cargo.lock file is |
| 62 | + up-to-date. If the lock file is missing, or it needs to be updated, |
| 63 | + Cargo will exit with an error. The --frozen flag also prevents Cargo |
| 64 | + from attempting to access the network to determine if it is |
| 65 | + out-of-date. |
| 66 | + |
| 67 | + These may be used in environments where you want to assert that the |
| 68 | + Cargo.lock file is up-to-date (such as a CI build) or want to avoid |
| 69 | + network access. |
| 70 | + |
| 71 | + --offline |
| 72 | + Prevents Cargo from accessing the network for any reason. Without |
| 73 | + this flag, Cargo will stop with an error if it needs to access the |
| 74 | + network and the network is not available. With this flag, Cargo will |
| 75 | + attempt to proceed without the network if possible. |
| 76 | + |
| 77 | + Beware that this may result in different dependency resolution than |
| 78 | + online mode. Cargo will restrict itself to crates that are |
| 79 | + downloaded locally, even if there might be a newer version as |
| 80 | + indicated in the local copy of the index. See the cargo-fetch(1) |
| 81 | + command to download dependencies before going offline. |
| 82 | + |
| 83 | + May also be specified with the net.offline config value |
| 84 | + <https://doc.rust-lang.org/cargo/reference/config.html>. |
| 85 | + |
| 86 | + Package Selection |
| 87 | + -p spec..., --package spec... |
| 88 | + Package to remove from. |
| 89 | + |
| 90 | + Common Options |
| 91 | + +toolchain |
| 92 | + If Cargo has been installed with rustup, and the first argument to |
| 93 | + cargo begins with +, it will be interpreted as a rustup toolchain |
| 94 | + name (such as +stable or +nightly). See the rustup documentation |
| 95 | + <https://rust-lang.github.io/rustup/overrides.html> for more |
| 96 | + information about how toolchain overrides work. |
| 97 | + |
| 98 | + --config KEY=VALUE or PATH |
| 99 | + Overrides a Cargo configuration value. The argument should be in |
| 100 | + TOML syntax of KEY=VALUE, or provided as a path to an extra |
| 101 | + configuration file. This flag may be specified multiple times. See |
| 102 | + the command-line overrides section |
| 103 | + <https://doc.rust-lang.org/cargo/reference/config.html#command-line-overrides> |
| 104 | + for more information. |
| 105 | + |
| 106 | + -h, --help |
| 107 | + Prints help information. |
| 108 | + |
| 109 | + -Z flag |
| 110 | + Unstable (nightly-only) flags to Cargo. Run cargo -Z help for |
| 111 | + details. |
| 112 | + |
| 113 | +ENVIRONMENT |
| 114 | + See the reference |
| 115 | + <https://doc.rust-lang.org/cargo/reference/environment-variables.html> |
| 116 | + for details on environment variables that Cargo reads. |
| 117 | + |
| 118 | +EXIT STATUS |
| 119 | + o 0: Cargo succeeded. |
| 120 | + |
| 121 | + o 101: Cargo failed to complete. |
| 122 | + |
| 123 | +EXAMPLES |
| 124 | + 1. Remove regex as a dependency |
| 125 | + |
| 126 | + cargo remove regex |
| 127 | + |
| 128 | + 2. Remove trybuild as a dev-dependency |
| 129 | + |
| 130 | + cargo remove --dev trybuild |
| 131 | + |
| 132 | + 3. Remove nom from the x86_64-pc-windows-gnu dependencies table |
| 133 | + |
| 134 | + cargo remove --target x86_64-pc-windows-gnu nom |
| 135 | + |
| 136 | +SEE ALSO |
| 137 | + cargo(1), cargo-add(1) |
| 138 | + |
0 commit comments