From: Collin Funk Date: Tue, 9 Dec 2025 04:15:07 +0000 (-0800) Subject: doc: printf: mention how to print arguments starting with '-' X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=828073db6be72373999a21cbb3b24fb2b0ea0f08;p=thirdparty%2Fcoreutils.git 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 --- 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}.