klyn.gui.terminal.ProgressBar.format
method
public static format(columns as Int, done as Long, total as Long, label as String = "Progress", bytes as Boolean = false) as String
Description

Formats a bar without output. One terminal column is left unused to avoid automatic line wrapping; redirected output uses an 80-column layout. Labels and counts may be shortened on narrow terminals, not the percentage.

Parameters
ParameterDescription
columnsAvailable columns, or zero for redirected output.
doneCompleted amount, within zero..total.
totalTotal amount of work.
labelDescription of the operation.
bytesShow MiB rather than raw counts.
Returns

A single line fitting the available width.

Throws
  • ValueException for invalid counts or a multiline/control label.
Example

text = ProgressBar.format(80, 50l, 100l, "Loading")