Skip to content

Commit

Permalink
completion: Make shell completion generation optional at compile time
Browse files Browse the repository at this point in the history
The future goal is to enable manual patches to the completion files, instead of using clap_complete
directly. We can use clap_complete during development, but the end user doesn't need it anymore
(saving on compile time and binary size).
  • Loading branch information
vincentdephily committed Mar 17, 2024
1 parent 4d4d350 commit fbc09fa
Show file tree
Hide file tree
Showing 7 changed files with 959 additions and 20 deletions.
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ missing_const_for_fn = "warn"
anyhow = "1.0.32"
atoi = "2.0.0"
clap = { version = "~4.4.11", features = ["cargo", "derive"] }
clap_complete = "~4.4.4"
clap_complete = { version = "~4.4.4", optional = true }
crossbeam-channel = "0.5.0"
env_logger = { version = "0.11.0", default-features = false, features = ["auto-color"] }
flate2 = "1.0.28"
Expand All @@ -49,6 +49,9 @@ path = "benches/exec_compare.rs"
# Experimental features, may require nightly compiler.
# Currently only benchmarking.
unstable = []
# Generate shell completions at runtime instead of using static version.
# Only intended for developers.
clap_complete = ["dep:clap_complete"]

[profile.release]
debug = false
Expand Down
Loading

0 comments on commit fbc09fa

Please sign in to comment.