Skip to content

Commit 9792256

Browse files
committed
refactor: disable progress indicators when verbose mode is enabled
When verbose mode is active, progress indicators are automatically disabled to avoid cluttering the output with competing information streams.
1 parent 6e15ea6 commit 9792256

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/app.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl App {
7575
}
7676

7777
// Step 1: Discover repo and get changes
78-
let progress = Progress::new();
78+
let progress = Progress::new(self.cli.verbose);
7979
progress.phase("Analyzing staged changes...");
8080

8181
let git = GitService::discover()?;
@@ -524,7 +524,7 @@ impl App {
524524
return Err(Error::SplitAborted);
525525
}
526526

527-
let progress = Progress::new();
527+
let progress = Progress::new(self.cli.verbose);
528528
// Generate messages for each group
529529
progress.phase(&format!(
530530
"Contacting {} ({})...",

src/services/progress.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@ pub struct Progress {
1717

1818
impl Default for Progress {
1919
fn default() -> Self {
20-
Self::new()
20+
Self::new(false)
2121
}
2222
}
2323

2424
impl Progress {
2525
/// Create a new progress indicator. Only shows spinners in interactive terminals.
26-
pub fn new() -> Self {
26+
/// If verbose is true, spinners are disabled to avoid conflict with debug logs.
27+
pub fn new(verbose: bool) -> Self {
2728
let is_tty = std::io::stderr().is_terminal();
2829
Self {
29-
bar: if is_tty {
30+
bar: if is_tty && !verbose {
3031
let pb = ProgressBar::new_spinner();
3132
pb.set_style(
3233
ProgressStyle::default_spinner()

0 commit comments

Comments
 (0)