]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
doc: Add an example regarding xgettext.
authorBruno Haible <bruno@clisp.org>
Fri, 18 Oct 2024 17:19:38 +0000 (19:19 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 18 Oct 2024 17:19:38 +0000 (19:19 +0200)
Reported by Andrea G. Monaco <andrea.monaco@autistici.org> in
<https://lists.gnu.org/archive/html/bug-gettext/2020-12/msg00036.html>.

* gettext-tools/doc/xgettext.texi: Add an example.

gettext-tools/doc/xgettext.texi

index 1aa98386584c4eab4c298b744975209933b2016f..ce78736e0815454c80310768519ce6d047ccf33b 100644 (file)
@@ -706,3 +706,18 @@ Output version information and exit.
 Increase verbosity level.
 
 @end table
+
+@subsection Example
+
+A sample invocation of @code{xgettext}, in a project
+that has a single source file @file{src/hello.c}
+that uses @samp{_} as shorthand for the @code{gettext} function,
+could be:
+
+@example
+xgettext -o hello.pot \
+         --add-comments=TRANSLATORS: \
+         --keyword=_ --flag=_:1:pass-c-format \
+         --directory=.. \
+         src/hello.c
+@end example