MCPcopy Create free account
hub / github.com/clawshell/clawshell / print_step

Function print_step

src/tui.rs:89–94  ·  view source on GitHub ↗

Print a step indicator like "[2/5] Doing something..." without advancing to the next line, so it can be updated in-place by a subsequent call to [`print_step_done`].

(step: usize, total: usize, msg: &str)

Source from the content-addressed store, hash-verified

87/// Print a step indicator like "[2/5] Doing something..." without advancing to the next line,
88/// so it can be updated in-place by a subsequent call to [`print_step_done`].
89pub fn print_step(step: usize, total: usize, msg: &str) {
90 let prefix = theme_style().apply_to(format!("[{step}/{total}]"));
91 // Clear the current line and print without newline
92 print!("\r\x1b[2K{prefix} {msg}");
93 let _ = std::io::stdout().flush();
94}
95
96/// Print a step completion message like "[2/5] Done ✓", overwriting the previous step
97/// indicator printed by [`print_step`] in-place, and then move to the next line.

Callers 4

cmd_onboardFunction · 0.85

Calls 1

theme_styleFunction · 0.85

Tested by 1