Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Riey/cargo-feature
Cargo plugin to manage dependency features
https://github.com/Riey/cargo-feature
Last synced: 3 months ago
JSON representation
Cargo plugin to manage dependency features
- Host: GitHub
- URL: https://github.com/Riey/cargo-feature
- Owner: Riey
- License: mit
- Created: 2020-03-23T11:17:18.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-23T00:12:11.000Z (almost 2 years ago)
- Last Synced: 2024-07-18T07:48:26.487Z (4 months ago)
- Language: Rust
- Homepage:
- Size: 432 KB
- Stars: 110
- Watchers: 4
- Forks: 7
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# cargo-feature
[![CI](https://github.com/Riey/cargo-feature/actions/workflows/ci.yml/badge.svg)](https://github.com/Riey/cargo-feature/actions/workflows/ci.yml)
[![Crates.io](https://img.shields.io/crates/v/cargo-feature)](https://crates.io/crates/cargo-feature)[![Packaging status](https://repology.org/badge/vertical-allrepos/cargo-feature.svg)](https://repology.org/project/cargo-feature/versions)
![preview](https://github.com/Riey/cargo-feature/raw/master/preview.png)
## Install
### Cargo
`cargo install cargo-feature`
### Arch
`pacman -S 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
```