diff options
author | Oliver Kiddle <opk@zsh.org> | 2021-11-12 20:33:52 +0100 |
---|---|---|
committer | Oliver Kiddle <opk@zsh.org> | 2021-11-12 20:33:52 +0100 |
commit | dfb7ac94bb4c28472d759a61ea3c2dab30cf9cd3 (patch) | |
tree | 1894d81725e4825c1b1948c0ccf1236b439e3710 /Doc | |
parent | 631576de0f7b4e52487175e3e017e5136424b626 (diff) | |
download | zsh-dfb7ac94bb4c28472d759a61ea3c2dab30cf9cd3.tar.gz zsh-dfb7ac94bb4c28472d759a61ea3c2dab30cf9cd3.tar.xz zsh-dfb7ac94bb4c28472d759a61ea3c2dab30cf9cd3.zip |
49561: add zformat -F option, similar to -f but ternary expressions check for existence instead of doing math evaluation
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/Zsh/mod_zutil.yo | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Doc/Zsh/mod_zutil.yo b/Doc/Zsh/mod_zutil.yo index 41d3dfdb0..3cf9e5028 100644 --- a/Doc/Zsh/mod_zutil.yo +++ b/Doc/Zsh/mod_zutil.yo @@ -150,8 +150,9 @@ enditem() ) findex(zformat) xitem(tt(zformat -f) var(param) var(format) var(spec) ...) +xitem(tt(zformat -F) var(param) var(format) var(spec) ...) item(tt(zformat -a) var(array) var(sep) var(spec) ...)( -This builtin provides two different forms of formatting. The first form +This builtin provides different forms of formatting. The first form is selected with the tt(-f) option. In this case the var(format) string will be modified by replacing sequences starting with a percent sign in it with strings from the var(spec)s. Each var(spec) should be @@ -195,7 +196,13 @@ outputs "The answer is 'yes'." to tt(REPLY) since the value for the format specifier tt(c) is 3, agreeing with the digit argument to the ternary expression. -The second form, using the tt(-a) option, can be used for aligning +With tt(-F) instead of tt(-f), ternary expressions choose between the +`true' or `false' text on the basis of whether the format specifier is +present and non-empty. A test number indicates a minimum width for the +value given in the format specifier. Negative numbers reverse this, +so the test is for whether the value exceeds a maximum width. + +The form, using the tt(-a) option, can be used for aligning strings. Here, the var(spec)s are of the form `var(left)tt(:)var(right)' where `var(left)' and `var(right)' are arbitrary strings. These strings are modified by replacing the colons |