From 828073db6be72373999a21cbb3b24fb2b0ea0f08 Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Mon, 8 Dec 2025 20:15:07 -0800 Subject: [PATCH] doc: printf: mention how to print arguments starting with '-' * doc/coreutils.texi (printDash): New macro. (printf invocation, yes invocation): Use it. Addresses https://bugs.gnu.org/79896 --- doc/coreutils.texi | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 57d426d1a9..5ff3865340 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -12928,8 +12928,14 @@ $ recode BIG5..JAVA < sample.txt \ > sample.sh @end example -The only options are a lone @option{--help} or -@option{--version}. @xref{Common options}. +@macro printDash{command} +To output an argument that begins with @samp{-}, precede it with +@option{--}, e.g., @samp{\command\ -- --help}. +@end macro + +The only options are a lone @option{--help} or @option{--version}. +@printDash{printf} +@xref{Common options}. Options must precede operands. @exitstatus @@ -12948,8 +12954,7 @@ given, it prints @samp{y} followed by a newline forever until killed. Upon a write error, @command{yes} exits with status @samp{1}. The only options are a lone @option{--help} or @option{--version}. -To output an argument that begins with -@samp{-}, precede it with @option{--}, e.g., @samp{yes -- --help}. +@printDash{yes} @xref{Common options}. -- 2.47.3