Skip to content

Commit

Permalink
first very basic version of line renderer progress - works…
Browse files Browse the repository at this point in the history
…but there are maby low hanging improvements to be made.
  • Loading branch information
Byron committed Jul 10, 2020
1 parent aac0d34 commit 0cc1bf2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
16 changes: 16 additions & 0 deletions src/plumbing/lean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<prodash::tree::Item>) {
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();
Expand Down

0 comments on commit 0cc1bf2

Please sign in to comment.