Expand description
Shared utilities for tool implementations.
Constants§
- ESTIMATED_
CHARS_ PER_ LINE - Generous estimate of average characters per line for buffer pre-allocation.
- LIKELY_
CHARS_ PER_ LINE_ MAX - A number of characters per line that’s likely to not be exceeded in most files.
Functions§
- format_
numbered_ line - Formats a line with its line number for output.
- truncate_
line - Truncates a single line to a maximum character count.
- truncate_
text - Truncates text to a maximum byte length, appending a truncation notice.