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 /* The three functions below display the --version information the
40 If COMMAND_NAME is NULL, the PACKAGE is assumed to be the name of
41 the program. The formats are therefore:
47 COMMAND_NAME (PACKAGE) VERSION.
49 The functions differ in the way they are passed author names. */
51 /* Display the --version information the standard way.
53 Author names are given in the array AUTHORS. N_AUTHORS is the
54 number of elements in the array. */
56 version_etc_arn (FILE *stream
,
57 const char *command_name
, const char *package
,
59 const char * const * authors
, size_t n_authors
)
62 fprintf (stream
, "%s (%s) %s\n", command_name
, package
, version
);
64 fprintf (stream
, "%s %s\n", package
, version
);
66 #ifdef PACKAGE_PACKAGER
67 # ifdef PACKAGE_PACKAGER_VERSION
68 fprintf (stream
, _("Packaged by %s (%s)\n"), PACKAGE_PACKAGER
,
69 PACKAGE_PACKAGER_VERSION
);
71 fprintf (stream
, _("Packaged by %s\n"), PACKAGE_PACKAGER
);
75 /* TRANSLATORS: Translate "(C)" to the copyright symbol
76 (C-in-a-circle), if this symbol is available in the user's
77 locale. Otherwise, do not translate "(C)"; leave it as-is. */
78 fprintf (stream
, version_etc_copyright
, _("(C)"), COPYRIGHT_YEAR
);
82 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\n\
83 This is free software: you are free to change and redistribute it.\n\
84 There is NO WARRANTY, to the extent permitted by law.\n\
92 /* The caller must provide at least one author name. */
95 /* TRANSLATORS: %s denotes an author name. */
96 fprintf (stream
, _("Written by %s.\n"), authors
[0]);
99 /* TRANSLATORS: Each %s denotes an author name. */
100 fprintf (stream
, _("Written by %s and %s.\n"), authors
[0], authors
[1]);
103 /* TRANSLATORS: Each %s denotes an author name. */
104 fprintf (stream
, _("Written by %s, %s, and %s.\n"),
105 authors
[0], authors
[1], authors
[2]);
108 /* TRANSLATORS: Each %s denotes an author name.
109 You can use line breaks, estimating that each author name occupies
110 ca. 16 screen columns and that a screen line has ca. 80 columns. */
111 fprintf (stream
, _("Written by %s, %s, %s,\nand %s.\n"),
112 authors
[0], authors
[1], authors
[2], authors
[3]);
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 fprintf (stream
, _("Written by %s, %s, %s,\n%s, and %s.\n"),
119 authors
[0], authors
[1], authors
[2], authors
[3], authors
[4]);
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 fprintf (stream
, _("Written by %s, %s, %s,\n%s, %s, and %s.\n"),
126 authors
[0], authors
[1], authors
[2], authors
[3], authors
[4],
130 /* TRANSLATORS: Each %s denotes an author name.
131 You can use line breaks, estimating that each author name occupies
132 ca. 16 screen columns and that a screen line has ca. 80 columns. */
133 fprintf (stream
, _("Written by %s, %s, %s,\n%s, %s, %s, and %s.\n"),
134 authors
[0], authors
[1], authors
[2], authors
[3], authors
[4],
135 authors
[5], authors
[6]);
138 /* TRANSLATORS: Each %s denotes an author name.
139 You can use line breaks, estimating that each author name occupies
140 ca. 16 screen columns and that a screen line has ca. 80 columns. */
141 fprintf (stream
, _("\
142 Written by %s, %s, %s,\n%s, %s, %s, %s,\nand %s.\n"),
143 authors
[0], authors
[1], authors
[2], authors
[3], authors
[4],
144 authors
[5], authors
[6], authors
[7]);
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 fprintf (stream
, _("\
151 Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, and %s.\n"),
152 authors
[0], authors
[1], authors
[2], authors
[3], authors
[4],
153 authors
[5], authors
[6], authors
[7], authors
[8]);
156 /* 10 or more authors. Use an abbreviation, since the human reader
157 will probably not want to read the entire list anyway. */
158 /* TRANSLATORS: Each %s denotes an author name.
159 You can use line breaks, estimating that each author name occupies
160 ca. 16 screen columns and that a screen line has ca. 80 columns. */
161 fprintf (stream
, _("\
162 Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, %s, and others.\n"),
163 authors
[0], authors
[1], authors
[2], authors
[3], authors
[4],
164 authors
[5], authors
[6], authors
[7], authors
[8]);
169 /* Display the --version information the standard way. See the initial
170 comment to this module, for more information.
172 Author names are given in the NULL-terminated array AUTHORS. */
174 version_etc_ar (FILE *stream
,
175 const char *command_name
, const char *package
,
176 const char *version
, const char * const * authors
)
180 for (n_authors
= 0; authors
[n_authors
]; n_authors
++)
182 version_etc_arn (stream
, command_name
, package
, version
, authors
, n_authors
);
185 /* Display the --version information the standard way. See the initial
186 comment to this module, for more information.
188 Author names are given in the NULL-terminated va_list AUTHORS. */
190 version_etc_va (FILE *stream
,
191 const char *command_name
, const char *package
,
192 const char *version
, va_list authors
)
195 const char *authtab
[10];
199 && (authtab
[n_authors
] = va_arg (authors
, const char *)) != NULL
;
202 version_etc_arn (stream
, command_name
, package
, version
,
207 /* Display the --version information the standard way.
209 If COMMAND_NAME is NULL, the PACKAGE is assumed to be the name of
210 the program. The formats are therefore:
216 COMMAND_NAME (PACKAGE) VERSION.
218 The authors names are passed as separate arguments, with an additional
219 NULL argument at the end. */
221 version_etc (FILE *stream
,
222 const char *command_name
, const char *package
,
223 const char *version
, /* const char *author1, ...*/ ...)
227 va_start (authors
, version
);
228 version_etc_va (stream
, command_name
, package
, version
, authors
);
233 emit_bug_reporting_address (void)
235 /* TRANSLATORS: The placeholder indicates the bug-reporting address
236 for this package. Please add _another line_ saying
237 "Report translation bugs to <...>\n" with the address for translation
238 bugs (typically your translation team's web or email address). */
239 printf (_("\nReport bugs to: %s\n"), PACKAGE_BUGREPORT
);
240 #ifdef PACKAGE_PACKAGER_BUG_REPORTS
241 printf (_("Report %s bugs to: %s\n"), PACKAGE_PACKAGER
,
242 PACKAGE_PACKAGER_BUG_REPORTS
);
245 printf (_("%s home page: <%s>\n"), PACKAGE_NAME
, PACKAGE_URL
);
247 printf (_("%s home page: <http://www.gnu.org/software/%s/>\n"),
248 PACKAGE_NAME
, PACKAGE
);
250 fputs (_("General help using GNU software: <http://www.gnu.org/gethelp/>\n"),