#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

#339 in Cargo plugins

Download history 42/week @ 2023-12-01 51/week @ 2023-12-08 38/week @ 2023-12-15 37/week @ 2023-12-22 24/week @ 2023-12-29 29/week @ 2024-01-05 30/week @ 2024-01-12 33/week @ 2024-01-19 30/week @ 2024-01-26 43/week @ 2024-02-02 48/week @ 2024-02-09 79/week @ 2024-02-16 105/week @ 2024-02-23 89/week @ 2024-03-01 141/week @ 2024-03-08 113/week @ 2024-03-15

462 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
~117K SLoC