All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] printf.3: Add overall structure of format string
@ 2021-03-19 23:57 Alejandro Colomar
  2021-04-04 19:32 ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 4+ messages in thread
From: Alejandro Colomar @ 2021-03-19 23:57 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Utkarsh Singh, linux-man, Alejandro Colomar

From: Utkarsh Singh <utkarsh190601@gmail.com>

Can we add a small syntax structure for format string in printf(3)
manual.  I personally find if easier to remember and scan.  This has
been taken from OpenBSD printf(3) manual.

Signed-off-by: Utkarsh Singh <utkarsh190601@gmail.com>
[ alx: ffix ]
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/printf.3 | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/man3/printf.3 b/man3/printf.3
index fa6564426..7c993074c 100644
--- a/man3/printf.3
+++ b/man3/printf.3
@@ -193,6 +193,14 @@ an optional
 and an optional
 .IR "length modifier" .
 .PP
+Overall syntax of format string is:
+.PP
+.in +4n
+.nf
+%[$][flags][width][.precision][length modifier]conversion
+.fi
+.in
+.PP
 The arguments must correspond properly (after type promotion) with the
 conversion specifier.
 By default, the arguments are used in the order
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] printf.3: Add overall structure of format string
  2021-03-19 23:57 [PATCH] printf.3: Add overall structure of format string Alejandro Colomar
@ 2021-04-04 19:32 ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-04-04 19:32 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, Utkarsh Singh, linux-man

Hi Alex,

On 3/20/21 12:57 AM, Alejandro Colomar wrote:
> From: Utkarsh Singh <utkarsh190601@gmail.com>
> 
> Can we add a small syntax structure for format string in printf(3)
> manual.  I personally find if easier to remember and scan.  This has
> been taken from OpenBSD printf(3) manual.

Patch applied.

Thanks,

Michael

> Signed-off-by: Utkarsh Singh <utkarsh190601@gmail.com>
> [ alx: ffix ]
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man3/printf.3 | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/man3/printf.3 b/man3/printf.3
> index fa6564426..7c993074c 100644
> --- a/man3/printf.3
> +++ b/man3/printf.3
> @@ -193,6 +193,14 @@ an optional
>  and an optional
>  .IR "length modifier" .
>  .PP
> +Overall syntax of format string is:
> +.PP
> +.in +4n
> +.nf
> +%[$][flags][width][.precision][length modifier]conversion
> +.fi
> +.in
> +.PP
>  The arguments must correspond properly (after type promotion) with the
>  conversion specifier.
>  By default, the arguments are used in the order
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] printf.3: Add overall structure of format string
  2021-03-08  8:15 [patch] " Utkarsh Singh
@ 2021-03-10 19:42 ` Alejandro Colomar (man-pages)
  0 siblings, 0 replies; 4+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-03-10 19:42 UTC (permalink / raw)
  To: Utkarsh Singh, linux-man, mtk.manpages

Hi Utkarsh,

On 3/8/21 9:15 AM, Utkarsh Singh wrote:
> Hi,
> 
> Thanks for creating and maintaining Linux man-pages project.
> 
> Can we add a small syntax structure for format string in printf(3)
> manual.  I personally find if easier to remember and scan.  This has
> been taken from OpenBSD printf(3) manual.

Great patch!  Thanks for the patch and for pointing to the source!

I applied the patch with some minor tweaks, and signed it on your 
behalf.  See 
<https://github.com/alejandro-colomar/man-pages/commit/7cff8229063ff758a51ebd475e51452f5c781a60>.

I prefer .nf/.fi so that it doesn't use a monospace font (it's not 
actual code) in PDF/HTML version.  Like we have in the synopsis.

Thanks,

Alex

> 
> diff --git a/man3/printf.3 b/man3/printf.3
> index fa6564426..69ff29316 100644
> --- a/man3/printf.3
> +++ b/man3/printf.3
> @@ -193,6 +193,13 @@ an optional
>   and an optional
>   .IR "length modifier" .
>   .PP
> +Overall syntax of format string is:
> +.PP
> +.in +4n
> +.EX
> +%[$][flags][width][.precision][length modifier]conversion
> +.EE
> +.PP
>   The arguments must correspond properly (after type promotion) with the
>   conversion specifier.
>   By default, the arguments are used in the order
> 

-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch] printf.3: Add overall structure of format string
@ 2021-03-08  8:15 Utkarsh Singh
  2021-03-10 19:42 ` Alejandro Colomar (man-pages)
  0 siblings, 1 reply; 4+ messages in thread
From: Utkarsh Singh @ 2021-03-08  8:15 UTC (permalink / raw)
  To: linux-man, alx.manpages, mtk.manpages

Hi,

Thanks for creating and maintaining Linux man-pages project.

Can we add a small syntax structure for format string in printf(3)
manual.  I personally find if easier to remember and scan.  This has
been taken from OpenBSD printf(3) manual.

diff --git a/man3/printf.3 b/man3/printf.3
index fa6564426..69ff29316 100644
--- a/man3/printf.3
+++ b/man3/printf.3
@@ -193,6 +193,13 @@ an optional
 and an optional
 .IR "length modifier" .
 .PP
+Overall syntax of format string is:
+.PP
+.in +4n
+.EX
+%[$][flags][width][.precision][length modifier]conversion
+.EE
+.PP
 The arguments must correspond properly (after type promotion) with the
 conversion specifier.
 By default, the arguments are used in the order
-- 
Utkarsh Singh

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-04 19:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-19 23:57 [PATCH] printf.3: Add overall structure of format string Alejandro Colomar
2021-04-04 19:32 ` Michael Kerrisk (man-pages)
  -- strict thread matches above, loose matches on Subject: below --
2021-03-08  8:15 [patch] " Utkarsh Singh
2021-03-10 19:42 ` Alejandro Colomar (man-pages)

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.