Skip to main content

haz_cli/output/
mod.rs

1//! Terminal-aware presentation for `haz run`.
2//!
3//! The module groups four concerns:
4//!
5//! - [`color_choice`] detects whether the live process should
6//!   emit ANSI colour sequences (both streams must be terminals
7//!   AND `NO_COLOR` must be unset / empty).
8//! - [`palette`] derives a deterministic 24-bit RGB colour for
9//!   each [`haz_domain::task_id::TaskId`] and supplies the small
10//!   ANSI-escape helpers.
11//! - [`duration`] formats a [`std::time::Duration`] in the
12//!   `176ms` / `7s 856ms` / `1m 23s` / `1h 23m` grammar both the
13//!   per-task summary lines and the run-level epilogue use.
14//! - [`presenter`] implements [`haz_exec::presenter::TaskPresenter`]
15//!   against those primitives.
16//!
17//! The `haz-exec` crate stays terminal- / colour-agnostic. Pulling
18//! this presenter through the existing `TaskPresenter` port is the
19//! single integration point: the binary picks the presenter at
20//! startup and feeds it into the observer it hands the scheduler.
21
22pub mod color_choice;
23pub mod duration;
24pub mod epilogue;
25pub mod palette;
26pub mod presenter;