#cargo #features #cargo-subcommand #crates #cli

app cargo-feature

Cargo plugin to manage dependency features

15 unstable releases (6 breaking)

0.7.0 May 9, 2022
0.6.0 Oct 31, 2021
0.5.5 Oct 26, 2021
0.5.2 Apr 8, 2021
0.2.0 Mar 25, 2020

#382 in Cargo plugins

Download history 122/week @ 2024-07-25 168/week @ 2024-08-01 137/week @ 2024-08-08 111/week @ 2024-08-15 91/week @ 2024-08-22 74/week @ 2024-08-29 63/week @ 2024-09-05 77/week @ 2024-09-12 87/week @ 2024-09-19 73/week @ 2024-09-26 63/week @ 2024-10-03 73/week @ 2024-10-10 100/week @ 2024-10-17 69/week @ 2024-10-24 125/week @ 2024-10-31 97/week @ 2024-11-07

408 downloads per month

MIT license

91KB
376 lines

cargo-feature

CI Crates.io

Packaging status

preview

Install

Cargo

cargo install cargo-feature

Arch

pacman -Syu cargo-feature

NixOS

nix-env -iA nixos.cargo-feature

Usage

# add serde_derive feature to build-dependency of serde
cargo feature -t build serde +serde_derive

# disable default-features
cargo feature serde ^default

# same as above but more explict
cargo feature serde --disable-default-features

# if you want list all features, just type crate name
cargo feature serde

# enable default-features
cargo feature serde default

# same as above but more explict
cargo feature serde --enable-default-features

# add HtmlDivElement feature to dependency of web_sys 
cargo feature web_sys +HtmlDivElement

# you can skip typing +
cargo feature web_sys HtmlDivElement

# same as above but use `target.'cfg(target_arch = "wasm32")'.dependencies`
cargo feature --target="cfg(target_arch = \"wasm32\")" web_sys HtmlDivElement

# use `^` to remove feature
cargo feature web_sys ^HtmlDivElement

Dependencies

~6.5MB
~115K SLoC