#cargo #cargo-subcommand #cli #feature #crates

app cargo-feature

Cargo plugin to manage dependency features

14 releases

0.6.0 Oct 31, 2021
0.5.3 Sep 26, 2021
0.5.2 Apr 8, 2021
0.5.1 Mar 29, 2021
0.2.0 Mar 25, 2020

#92 in Cargo plugins

Download history 11/week @ 2021-08-09 28/week @ 2021-08-16 14/week @ 2021-08-23 7/week @ 2021-08-30 15/week @ 2021-09-06 8/week @ 2021-09-13 35/week @ 2021-09-20 53/week @ 2021-09-27 42/week @ 2021-10-04 21/week @ 2021-10-11 34/week @ 2021-10-18 98/week @ 2021-10-25 93/week @ 2021-11-01 55/week @ 2021-11-08 42/week @ 2021-11-15 27/week @ 2021-11-22

130 downloads per month

MIT license

89KB
338 lines

cargo-feature

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

~5.5MB
~103K SLoC