string shorten: Make max of 0 mean no shortening

This makes it easier to just slot in `string shorten` wherever,
without having to do a weird "if test $max -gt 0" check.
This commit is contained in:
Fabian Boehm
2022-10-04 18:44:21 +02:00
parent e4f07fe010
commit cb28b39b24
3 changed files with 22 additions and 1 deletions

View File

@@ -22,7 +22,7 @@ Description
The escape sequences reflect what fish knows about, and how it computes its output. Your terminal might support more escapes, or not support escape sequences that fish knows about.
If **-m** or **--max** is given, truncate at the given width. Otherwise, the lowest non-zero width of all input strings is used.
If **-m** or **--max** is given, truncate at the given width. Otherwise, the lowest non-zero width of all input strings is used. A max of 0 means no shortening takes place, all STRINGs are printed as-is.
If **-N** or **--no-newline** is given, only the first line (or last line with **--left**) of each STRING is used, and an ellipsis is added if it was multiline. This only works for STRINGs being given as arguments, multiple lines given on stdin will be interpreted as separate STRINGs instead.