KScript docs
EN

progress_bar fields and methods

A field is a plain fact about the value, read with a dot and no brackets: $value.name. A method takes arguments or does work, and is called with ->: $value->name(arguments), or with the value piped in: $value |> name(arguments).

Fields

FieldTypeDescription
.currentnumberHow many steps are done.
.labelstringThe bar's label.
.totalnumberHow many steps there are.

From KScript.Terminal

These need <import package="KScript.Terminal" />import KScript.Terminal. See KScript.Terminal.

#progress_bar->advance(by?: number) → progress_bar KScript.Terminal

Moves the bar on by a number of steps (1 by default) and returns it. Reaching the total finishes the bar.
ParameterTakes
by optionalnumber
Example
<import package="KScript.Terminal" />
<progress into="bar" total="10">Copying</progress>
<do>$bar->advance(4)</do>
<do>$bar->advance(6)</do>
import KScript.Terminal
progress(into: bar, total: 10) "Copying"
$bar->advance(4)
$bar->advance(6)

Methods from any