diff mbox series

[v3,1/2] man: printf: reword to avoid confusion v/v Ar argument[s]/arguments

Message ID 50b331b19b78fd56c5b2190f1f922a755e5f3270.1671063918.git.nabijaczleweli@nabijaczleweli.xyz (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series [v3,1/2] man: printf: reword to avoid confusion v/v Ar argument[s]/arguments | expand

Commit Message

наб Dec. 15, 2022, 12:25 a.m. UTC
The current wording says that given
  printf a b c d
a is the format, c and d are processed as noted,
but b is unspecified
---
Resending my patchset from August

 src/dash.1 | 29 +++++++++++++----------------
 1 file changed, 13 insertions(+), 16 deletions(-)

Comments

Herbert Xu Jan. 5, 2023, 9:45 a.m. UTC | #1
наб <nabijaczleweli@nabijaczleweli.xyz> wrote:
> [-- text/plain, encoding quoted-printable, charset: us-ascii, 75 lines --]
> 
> The current wording says that given
>  printf a b c d
> a is the format, c and d are processed as noted,
> but b is unspecified
> ---
> Resending my patchset from August
> 
> src/dash.1 | 29 +++++++++++++----------------
> 1 file changed, 13 insertions(+), 16 deletions(-)

All applied.  Thanks.
diff mbox series

Patch

diff --git a/src/dash.1 b/src/dash.1
index ff02237..310f34e 100644
--- a/src/dash.1
+++ b/src/dash.1
@@ -1528,30 +1528,26 @@  With the
 option specified the output will be formatted suitably for non-interactive use.
 .\".Pp
 .It Xo printf Ar format
-.Op Ar arguments  ...
+.Oo Ar value Oc Ns ...
 .Xc
 .Ic printf
-formats and prints its arguments, after the first, under control
-of the
-.Ar format  .
-The
-.Ar format
-is a character string which contains three types of objects: plain characters,
+formats and prints its arguments according to
+.Ar format ,
+a character string which contains three types of objects: plain characters,
 which are simply copied to standard output, character escape sequences which
 are converted and copied to the standard output, and format specifications,
 each of which causes printing of the next successive
-.Ar argument  .
+.Ar value .
 .Pp
-The
-.Ar arguments
-after the first are treated as strings if the corresponding format is
+Each
+.Ar value
+is treated as a string if the corresponding format specification is
 either
 .Cm b ,
-.Cm c
+.Cm c ,
 or
 .Cm s ;
-otherwise it is evaluated as a C constant, with the following extensions:
-.Pp
+otherwise it is evaluated as a C constant, with the following additions:
 .Bl -bullet -offset indent -compact
 .It
 A leading plus or minus sign is allowed.
@@ -1561,8 +1557,9 @@  If the leading character is a single or double quote, the value is the
 code of the next character.
 .El
 .Pp
-The format string is reused as often as necessary to satisfy the
-.Ar arguments  .
+The format string is reused as often as necessary until all
+.Ar value Ns s
+are consumed.
 Any extra format specifications are evaluated with zero or the null
 string.
 .Pp