All of lore.kernel.org
 help / color / mirror / Atom feed
From: наб <nabijaczleweli@nabijaczleweli.xyz>
To: dash@vger.kernel.org, Harald van Dijk <harald@gigawatt.nl>
Subject: [PATCH v2 1/2] man: printf: reword to avoid confusion v/v Ar argument[s]/arguments
Date: Sun, 14 Aug 2022 16:19:02 +0200	[thread overview]
Message-ID: <0d82c5a6b3a84ec3c6f5eb3513e4800f2f1f601a.1660486650.git.nabijaczleweli@nabijaczleweli.xyz> (raw)
In-Reply-To: <af8be241-f3cc-4ca9-ee49-e856e658c683@gigawatt.nl>

[-- Attachment #1: Type: text/plain, Size: 2326 bytes --]

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

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
That's a fair cop, considering the manual already abuses Ar arguments as
Ar argument and arguments.

Please consider the following updated patch, which calls the arguments
consumed by conversions "value"s.

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

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
-- 
2.30.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-08-14 14:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-14  0:19 [PATCH 1/2] man: printf: all Ar arguments are processed identically наб
2022-08-14  0:20 ` [PATCH 2/2] man: printf: in 'X, X is a byte under dash наб
2022-08-14  1:11 ` [PATCH 1/2] man: printf: all Ar arguments are processed identically Harald van Dijk
2022-08-14 14:19   ` наб [this message]
2022-08-14 14:19   ` [PATCH v2 2/2] man: printf: in 'X, X is a byte under dash наб

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0d82c5a6b3a84ec3c6f5eb3513e4800f2f1f601a.1660486650.git.nabijaczleweli@nabijaczleweli.xyz \
    --to=nabijaczleweli@nabijaczleweli.xyz \
    --cc=dash@vger.kernel.org \
    --cc=harald@gigawatt.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.