1 /* Print --version and bug-reporting information in a consistent format.
2 Copyright (C) 1999-2009 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17 /* Written by Jim Meyering. */
22 #include "version-etc.h"
29 # include "unlocked-io.h"
33 #define _(msgid) gettext (msgid)
35 enum { COPYRIGHT_YEAR = 2009 };
37 /* Like version_etc, below, but with the NULL-terminated author list
38 provided via a variable of type va_list. */
40 version_etc_va (FILE *stream,
41 const char *command_name, const char *package,
42 const char *version, va_list authors)
46 /* Count the number of authors. */
50 va_copy (tmp_authors, authors);
53 while (va_arg (tmp_authors, const char *) != NULL)
58 fprintf (stream, "%s (%s) %s\n", command_name, package, version);
60 fprintf (stream, "%s %s\n", package, version);
62 #ifdef PACKAGE_PACKAGER
63 # ifdef PACKAGE_PACKAGER_VERSION
64 fprintf (stream, _("Packaged by %s (%s)\n"), PACKAGE_PACKAGER,
65 PACKAGE_PACKAGER_VERSION);
67 fprintf (stream, _("Packaged by %s\n"), PACKAGE_PACKAGER);
71 /* TRANSLATORS: Translate "(C)" to the copyright symbol
72 (C-in-a-circle), if this symbol is available in the user's
73 locale. Otherwise, do not translate "(C)"; leave it as-is. */
74 fprintf (stream, version_etc_copyright, _("(C)"), COPYRIGHT_YEAR);
78 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\n\
79 This is free software: you are free to change and redistribute it.\n\
80 There is NO WARRANTY, to the extent permitted by law.\n\
88 /* The caller must provide at least one author name. */
91 /* TRANSLATORS: %s denotes an author name. */
92 vfprintf (stream, _("Written by %s.\n"), authors);
95 /* TRANSLATORS: Each %s denotes an author name. */
96 vfprintf (stream, _("Written by %s and %s.\n"), authors);
99 /* TRANSLATORS: Each %s denotes an author name. */
100 vfprintf (stream, _("Written by %s, %s, and %s.\n"), authors);
103 /* TRANSLATORS: Each %s denotes an author name.
104 You can use line breaks, estimating that each author name occupies
105 ca. 16 screen columns and that a screen line has ca. 80 columns. */
106 vfprintf (stream, _("Written by %s, %s, %s,\nand %s.\n"), authors);
109 /* TRANSLATORS: Each %s denotes an author name.
110 You can use line breaks, estimating that each author name occupies
111 ca. 16 screen columns and that a screen line has ca. 80 columns. */
112 vfprintf (stream, _("Written by %s, %s, %s,\n%s, and %s.\n"), authors);
115 /* TRANSLATORS: Each %s denotes an author name.
116 You can use line breaks, estimating that each author name occupies
117 ca. 16 screen columns and that a screen line has ca. 80 columns. */
118 vfprintf (stream, _("Written by %s, %s, %s,\n%s, %s, and %s.\n"),
122 /* TRANSLATORS: Each %s denotes an author name.
123 You can use line breaks, estimating that each author name occupies
124 ca. 16 screen columns and that a screen line has ca. 80 columns. */
125 vfprintf (stream, _("Written by %s, %s, %s,\n%s, %s, %s, and %s.\n"),
129 /* TRANSLATORS: Each %s denotes an author name.
130 You can use line breaks, estimating that each author name occupies
131 ca. 16 screen columns and that a screen line has ca. 80 columns. */
132 vfprintf (stream, _("\
133 Written by %s, %s, %s,\n%s, %s, %s, %s,\nand %s.\n"),
137 /* TRANSLATORS: Each %s denotes an author name.
138 You can use line breaks, estimating that each author name occupies
139 ca. 16 screen columns and that a screen line has ca. 80 columns. */
140 vfprintf (stream, _("\
141 Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, and %s.\n"),
145 /* 10 or more authors. Use an abbreviation, since the human reader
146 will probably not want to read the entire list anyway. */
147 /* TRANSLATORS: Each %s denotes an author name.
148 You can use line breaks, estimating that each author name occupies
149 ca. 16 screen columns and that a screen line has ca. 80 columns. */
150 vfprintf (stream, _("\
151 Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, %s, and others.\n"),
159 /* Display the --version information the standard way.
161 If COMMAND_NAME is NULL, the PACKAGE is asumed to be the name of
162 the program. The formats are therefore:
168 COMMAND_NAME (PACKAGE) VERSION.
170 The author names are passed as separate arguments, with an additional
171 NULL argument at the end. */
173 version_etc (FILE *stream,
174 const char *command_name, const char *package,
175 const char *version, /* const char *author1, ...*/ ...)
179 va_start (authors, version);
180 version_etc_va (stream, command_name, package, version, authors);
184 emit_bug_reporting_address (void)
186 /* TRANSLATORS: The placeholder indicates the bug-reporting address
187 for this package. Please add _another line_ saying
188 "Report translation bugs to <...>\n" with the address for translation
189 bugs (typically your translation team's web or email address). */
190 printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
191 #ifdef PACKAGE_PACKAGER_BUG_REPORTS
192 printf (_("Report %s bugs to <%s>.\n"), PACKAGE_PACKAGER,
193 PACKAGE_PACKAGER_BUG_REPORTS);
195 printf (_("%s home page: <http://www.gnu.org/software/%s/>.\n"),
196 PACKAGE_NAME, PACKAGE);
197 fputs (_("General help using GNU software: <http://www.gnu.org/gethelp/>.\n"),