Add `cli` default feature to remove unnecessary dependencies from library (#1203)

This commit is contained in:
Ilaï Deutel 2025-09-15 12:40:05 -04:00 committed by GitHub
parent f78be23e9c
commit 7535d00140
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 4 deletions

View File

@ -25,13 +25,18 @@ edition = "2021"
[features]
all = ["cbor", "yaml"]
cbor = ["dep:hex", "dep:serde_cbor"]
default = []
cli = ["dep:clap", "dep:colored", "dep:env_logger", "dep:num-format"]
default = ["cli"]
yaml = ["dep:serde_yaml"]
[profile.release]
lto = "thin"
panic = "abort"
[[bin]]
name = "tokei"
required-features = ["cli"]
[build-dependencies]
tera = "1.20.0"
ignore = "0.4.22"
@ -41,8 +46,8 @@ json5 = "0.4.1"
[dependencies]
aho-corasick = "1.1.3"
arbitrary = { version = "1.3.2", features = ["derive"] }
clap = { version = "4", features = ["cargo", "string", "wrap_help"] }
colored = "2.1.0"
clap = { version = "4", optional = true, features = ["cargo", "string", "wrap_help"] }
colored = { version = "2.1.0", optional = true }
crossbeam-channel = "0.5.13"
encoding_rs_io = "0.1.7"
grep-searcher = "0.1.13"
@ -54,7 +59,7 @@ term_size = "0.3.2"
toml = "0.8.19"
parking_lot = "0.12.3"
dashmap = { version = "6.0.1", features = ["serde"] }
num-format = "0.4.4"
num-format = { version = "0.4.4", optional = true }
once_cell = "1.19.0"
regex = "1.10.6"
serde_json = "1.0.125"
@ -62,6 +67,7 @@ etcetera = "0.8.0"
table_formatter = "0.6.1"
[dependencies.env_logger]
optional = true
features = []
version = "0.11.5"