├── .gitignore
├── src
├── io
│ ├── mod.rs
│ ├── parsing
│ │ ├── mod.rs
│ │ ├── workspace.rs
│ │ ├── package.rs
│ │ └── dependency.rs
│ ├── save.rs
│ └── util.rs
├── edit
│ ├── mod.rs
│ ├── search.rs
│ ├── filter_view
│ │ ├── item.rs
│ │ └── mod.rs
│ └── display.rs
├── project
│ ├── mod.rs
│ ├── package.rs
│ ├── dependency
│ │ ├── feature.rs
│ │ └── mod.rs
│ └── document.rs
├── main.rs
└── prune
│ ├── parse.rs
│ ├── display.rs
│ └── mod.rs
├── resources
├── greenMark.png
├── greyFeature.png
├── greyDependency.png
├── featureDependency.png
├── featureSelector.png
├── workspaceFeatures.png
├── dependencySelector.png
└── featurePackageDependency.png
├── .idea
├── vcs.xml
├── .gitignore
├── modules.xml
└── crates-feature-manager.iml
├── Known-Features.toml
├── LICENSE
├── Cargo.toml
├── CHANGELOG.md
├── README.md
└── Cargo.lock
/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 |
--------------------------------------------------------------------------------
/src/io/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod parsing;
2 | pub mod save;
3 | pub mod util;
4 |
--------------------------------------------------------------------------------
/src/edit/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod display;
2 | pub mod search;
3 |
4 | pub mod filter_view;
5 |
--------------------------------------------------------------------------------
/src/project/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod dependency;
2 | pub mod document;
3 | pub mod package;
4 |
--------------------------------------------------------------------------------
/src/io/parsing/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod dependency;
2 | pub mod package;
3 | pub mod workspace;
4 |
--------------------------------------------------------------------------------
/resources/greenMark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ToBinio/cargo-features-manager/HEAD/resources/greenMark.png
--------------------------------------------------------------------------------
/resources/greyFeature.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ToBinio/cargo-features-manager/HEAD/resources/greyFeature.png
--------------------------------------------------------------------------------
/resources/greyDependency.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ToBinio/cargo-features-manager/HEAD/resources/greyDependency.png
--------------------------------------------------------------------------------
/resources/featureDependency.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ToBinio/cargo-features-manager/HEAD/resources/featureDependency.png
--------------------------------------------------------------------------------
/resources/featureSelector.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ToBinio/cargo-features-manager/HEAD/resources/featureSelector.png
--------------------------------------------------------------------------------
/resources/workspaceFeatures.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ToBinio/cargo-features-manager/HEAD/resources/workspaceFeatures.png
--------------------------------------------------------------------------------
/resources/dependencySelector.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ToBinio/cargo-features-manager/HEAD/resources/dependencySelector.png
--------------------------------------------------------------------------------
/resources/featurePackageDependency.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ToBinio/cargo-features-manager/HEAD/resources/featurePackageDependency.png
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Known-Features.toml:
--------------------------------------------------------------------------------
1 | clap = ["default"]
2 | color-eyre = ["default"]
3 | regex = ["default"]
4 | serde_json = ["preserve_order"]
5 | rocket = ["http2"]
6 | hyper = ["http2"]
7 | hyper-util = ["http2"]
8 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Editor-based HTTP Client requests
5 | /httpRequests/
6 | # Datasource local storage ignored files
7 | /dataSources/
8 | /dataSources.local.xml
9 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/crates-feature-manager.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/edit/search.rs:
--------------------------------------------------------------------------------
1 | use console::style;
2 |
3 | pub fn highlight_search(text: &str, highlighted_letters: &[usize], is_dark: bool) -> String {
4 | text.chars()
5 | .enumerate()
6 | .map(|(index, c)| {
7 | match (is_dark, highlighted_letters.contains(&index)) {
8 | (false, true) => style(c).red().to_string(),
9 | (false, false) => c.to_string(),
10 | //dark red
11 | (true, true) => style(c).color256(1).to_string(),
12 | //light gray
13 | (true, false) => style(c).color256(8).to_string(),
14 | }
15 | })
16 | .collect()
17 | }
18 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 ToBinio
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "cargo-features-manager"
3 | version = "0.10.2"
4 | edition = "2024"
5 | authors = ["ToBinio"]
6 | license = "MIT"
7 | description = "A tui tool to enable/disable & prune dependency features"
8 | categories = ["command-line-utilities"]
9 | repository = "https://github.com/ToBinio/cargo-features-manager"
10 | keywords = ["cli", "manager", "cargo", "crates", "feature"]
11 | homepage = "https://github.com/ToBinio/cargo-features-manager.git"
12 | readme = "README.md"
13 | rust-version = "1.85.0"
14 | include = ["src/**/*", "LICENSE", "README.md", "Known-Features.toml"]
15 |
16 | [dependencies]
17 | color-eyre = "0.6.3"
18 | cargo_metadata = "0.23.0"
19 | clap = { version = "4.5.31", features = ["derive"] }
20 | clap_complete = "4.5.46"
21 | console = { version = "0.16.1", features = ["std"], default-features = false }
22 | ctrlc = "3.4.5"
23 | fuzzy-matcher = "0.3.7"
24 | itertools = { version = "0.14.0", default-features = false, features = ["use_alloc"] }
25 | semver = { version = "1.0.25", default-features = false }
26 | toml_edit = "0.23.7"
27 | tempfile = { version = "3.20.0", default-features = false }
28 | copy_dir = "0.1.3"
29 |
30 | [[bin]]
31 | name = "cargo-features"
32 | path = "src/main.rs"
33 |
--------------------------------------------------------------------------------
/src/io/parsing/workspace.rs:
--------------------------------------------------------------------------------
1 | use crate::io::parsing::dependency::parse_dependency_from_item;
2 | use crate::io::util::toml_document_from_path;
3 | use crate::project::dependency::Dependency;
4 | use crate::project::package::Package;
5 | use cargo_metadata::PackageId;
6 | use color_eyre::Result;
7 | use color_eyre::eyre::eyre;
8 | use console::Emoji;
9 | use std::collections::HashMap;
10 |
11 | pub fn parse_workspace(
12 | path: &str,
13 | packages: &HashMap,
14 | ) -> Result