Skip to main content

width_of

Function width_of 

Source
pub fn width_of(wide: bool, columns: Option<&str>) -> usize
Expand description

The width a --wide and a COLUMNS reading come to.

Without --wide the answer is WIDTH and the reading is not consulted, so a run in a 40-column terminal and a run piped into a file write the same bytes. With it the reading is held to [WIDTH, WIDEST]: a narrower terminal gets 80 because the text was written to be read at 80, and a wider one gets 120 because a line of prose past that is harder to read rather than easier. A COLUMNS that is absent or is not a number is the same answer as no --wide at all.