]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: printf: mention how to print arguments starting with '-'
authorCollin Funk <collin.funk1@gmail.com>
Tue, 9 Dec 2025 04:15:07 +0000 (20:15 -0800)
committerCollin Funk <collin.funk1@gmail.com>
Wed, 10 Dec 2025 02:45:22 +0000 (18:45 -0800)
* doc/coreutils.texi (printDash): New macro.
(printf invocation, yes invocation): Use it.
Addresses https://bugs.gnu.org/79896

doc/coreutils.texi

index 57d426d1a9eff7374810916bf53ab36753c54b46..5ff38653409f150f10ec331cdc26f191fad80c63 100644 (file)
@@ -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}.