Skip to contentSkip to conversation

printf.3: Add overall structure of format string

PATCH In review Utkarsh Singh 2 participants 2 messages Mar 8, 2021 – Mar 10, 2021 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 printf.3: Add overall structure of format string

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.

man3/printf.3 +7 -0
index fa6564426..69ff29316 100644
@@ -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
Signature · 1 line
Utkarsh Singh
#1 lore raw

Hi Utkarsh,

Quoted 7 lines · Utkarsh Singh

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

Quoted 20 lines
man3/printf.3 +7 -0
index fa6564426..69ff29316 100644
@@ -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
Signature · 3 lines
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/