Skip to main content

Module progress

Module progress 

Source
Expand description

§Progress Indicators

Shared progress display utilities for long-running CLI operations. Uses indicatif spinners and progress bars, respecting --no-color and non-TTY contexts (e.g. pipes).

§Usage

ⓘ
use scope_cli::cli::{output::Output, progress::Spinner};

let out = Output::stdio();
let sp = Spinner::new("Fetching address data...", &out);
// ... do work ...
sp.finish("Address data loaded.");

§Prompts

A bar that draws on the terminal is registered here. paused stops every registered bar while it runs a closure, so an interactive prompt (crate::cli::prompt::ask) is never drawn over. Lines a command prints next to a bar (Spinner::println) go through its Output, so the TUI keeps a copy; the bar’s own finish line is progress and is not copied.

Structs§

Spinner
A simple spinner for single-step or short sequential operations.
StepProgress
A counted progress bar for multi-step operations (X of Y).