Skip to main content

Crate cmd_usage

Crate cmd_usage 

Source

Modules§

arkuse
cli
ocuse

Functions§

clip_to_width
Keep a frame line from auto-wrapping: count visible columns ignoring SGR escapes and control chars, and drop trailing visible chars that would push past cols. Appends a reset so a truncated color run can’t leak.
redraw_frame
In-place terminal redraw of one frame. Assumes the cursor parks on the previous frame’s last line (no trailing newline). Returns the new frame’s line count so the caller can pass it back as prev_lines.
run
term_size
Terminal (rows, cols) from stty size. None when not a tty or the probe fails — redraw then skips clipping (safe: non-tty can’t wrap). Deliberately UNcached: the watch loop re-queries every refresh so resizing mid-run switches between the full and compact dashboards live.