diff --git a/Cargo.toml b/Cargo.toml index 79ee0db8f70..c80b1aeace2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ doctest = false [features] default = ["max"] max = ["fast", "pretty-cli"] -lean = ["fast", "lean-cli"] +lean = ["fast", "lean-cli", "prodash-line-renderer-crossterm", "git-features/progress-prodash"] small = ["lean-cli"] fast = ["git-features/parallel", "git-features/fast-sha1"] diff --git a/src/plumbing/lean.rs b/src/plumbing/lean.rs index 91e262dd975..b132798897f 100644 --- a/src/plumbing/lean.rs +++ b/src/plumbing/lean.rs @@ -50,6 +50,22 @@ fn prepare(verbose: bool, name: &str) -> ((), progress::Log) { ((), progress::Log::new(name, Some(1))) } +#[cfg(any( + feature = "prodash-line-renderer-crossterm", + feature = "prodash-line-renderer-termion" +))] +fn prepare(verbose: bool, name: &str) -> (prodash::line::JoinHandle, progress::DoOrDiscard) { + super::init_env_logger(false); + + let progress = prodash::Tree::new(); + let sub_progress = progress.add_child(name); + let handle = prodash::line::render(stderr(), progress, prodash::line::Options::default()); + ( + handle, + progress::DoOrDiscard::from(if verbose { Some(sub_progress) } else { None }), + ) +} + pub fn main() -> Result<()> { pub use options::*; let cli: Args = crate::shared::from_env();