jj_cli

Module text_util

Source

Functions§

  • Shortens text to max_width by removing trailing characters. ellipsis is added if the text gets truncated.
  • Shortens text to max_width by removing leading characters. ellipsis is added if the text gets truncated.
  • Wraps lines at the given width, returns a vector of lines (excluding “\n”.)
  • Indents each line by the given prefix preserving labels.
  • Writes text padded to min_width by adding leading fill characters.
  • Writes text padded to min_width by adding leading fill characters.
  • Writes text truncated to max_width by removing trailing characters. Returns width of the truncated text, which may be shorter than max_width.
  • Writes text truncated to max_width by removing leading characters. Returns width of the truncated text, which may be shorter than max_width.
  • Wraps lines at the given width preserving labels.