def pad_right
import bend-kit-tty@0.1.0.1/text.bend as Textimport Base
42# Append spaces until text occupies at least cols display columns.
43def pad_right(+text: String, +cols: U32) -> String:
44 +w = width(text)
45 +n = Bool.pick(U32, U32.is_lt(w, cols), (cols - w : U32), 0)
46 String.append(text, String.repeat(" ", U32.to_nat(n)))