summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2021-01-05 15:27:51 +0200
committerSergey Poznyakoff <gray@gnu.org>2021-01-05 15:27:51 +0200
commit4032f49b54897cd3bbcfaa2a213002c921ef5f16 (patch)
tree193e629ec106087ffbf3a2eb87a2c8d1519266e0
parentfa03ad4aed00d6df8c2bf556e378177b97c0c0c7 (diff)
downloadmailutils-4032f49b54897cd3bbcfaa2a213002c921ef5f16.tar.gz
mailutils-4032f49b54897cd3bbcfaa2a213002c921ef5f16.tar.bz2
Fix version output
* include/mailutils/cli.h (mu_copyright_year): New extern. (mu_version_print): New proto. * libmailutils/cli/cli.c (mu_copyright_year): New variable. Should be updated once a year. (mu_version_print): New function. (mu_version_hook): Use mu_version_print. * mail/mail.c (mail_warranty): Use mu_version_print.
-rw-r--r--include/mailutils/cli.h2
-rw-r--r--libmailutils/cli/cli.c13
-rw-r--r--mail/mail.c21
3 files changed, 13 insertions, 23 deletions
diff --git a/include/mailutils/cli.h b/include/mailutils/cli.h
index c13fb3f7e..56c350e41 100644
--- a/include/mailutils/cli.h
+++ b/include/mailutils/cli.h
@@ -60,3 +60,5 @@ extern const char mu_version_copyright[];
extern const char mu_general_help_text[];
+extern int mu_copyright_year;
+void mu_version_print (mu_stream_t stream);
void mu_version_hook (struct mu_parseopt *po, mu_stream_t stream);
diff --git a/libmailutils/cli/cli.c b/libmailutils/cli/cli.c
index 948826891..cad717ecd 100644
--- a/libmailutils/cli/cli.c
+++ b/libmailutils/cli/cli.c
@@ -57,6 +57,7 @@ const char mu_version_copyright[] =
year. */
- "Copyright %s 2007-2019 Free Software Foundation, inc.";
+ "Copyright %s 2007-%d Free Software Foundation, inc.";
+int mu_copyright_year = 2021;
void
-mu_version_hook (struct mu_parseopt *po, mu_stream_t stream)
+mu_version_print (mu_stream_t stream)
{
@@ -74,3 +75,3 @@ mu_version_hook (struct mu_parseopt *po, mu_stream_t stream)
locale. Otherwise, do not translate "(C)"; leave it as-is. */
- mu_stream_printf (stream, mu_version_copyright, _("(C)"));
+ mu_stream_printf (stream, mu_version_copyright, _("(C)"), mu_copyright_year);
mu_stream_printf (stream, _("\
@@ -83,2 +84,8 @@ There is NO WARRANTY, to the extent permitted by law.\n\
+void
+mu_version_hook (struct mu_parseopt *po, mu_stream_t stream)
+{
+ mu_version_print (stream);
+}
+
const char mu_general_help_text[] =
diff --git a/mail/mail.c b/mail/mail.c
index 9814eb82e..69bda9e77 100644
--- a/mail/mail.c
+++ b/mail/mail.c
@@ -740,22 +740,3 @@ mail_warranty (int argc MU_ARG_UNUSED, char **argv MU_ARG_UNUSED)
{
- mu_printf (
- _("GNU Mailutils -- a suite of utilities for electronic mail\n"
- "Copyright (C) 1999-2019 Free Software Foundation, Inc.\n\n"));
- mu_printf (
- _(" GNU Mailutils is free software; you can redistribute it and/or modify\n"
- " it under the terms of the GNU General Public License as published by\n"
- " the Free Software Foundation; either version 3 of the License, or\n"
- " (at your option) any later version.\n"
- "\n"
- " GNU Mailutils is distributed in the hope that it will be useful,\n"
- " but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
- " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
- " GNU General Public License for more details.\n"
- "\n"
- " You should have received a copy of the GNU General Public License along\n"
- " with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.\n"
- "\n"
- "\n"
-));
-
+ mu_version_print (mu_strout);
return 0;

Return to:

Send suggestions and report system problems to the System administrator.