summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-08-30 10:52:39 +0200
committerJim Meyering <meyering@redhat.com>2010-08-30 10:54:49 +0200
commit24037ee44d0e4c2bb22c31fe9e3747ab13caf22b (patch)
tree23f2ffa1c4d34a315975bf399e33c0989d68c9d9 /src
parentf53baaf7a98c2fbc43eba67a760e62679c53ce50 (diff)
downloadgrep-24037ee44d0e4c2bb22c31fe9e3747ab13caf22b.tar.gz
maint: use gnulib's standard --version-printing code
This includes author names and keeps the copyright year up to date. * bootstrap.conf (gnulib_modules): Add propername and version-etc-fsf. * src/main.c (AUTHORS): Define. (main): Use version_etc, rather than hard-coding the copyright text. Prompted by a patch from Paolo Bonzini.
Diffstat (limited to 'src')
-rw-r--r--src/main.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main.c b/src/main.c
index 53149128..6f5c4aea 100644
--- a/src/main.c
+++ b/src/main.c
@@ -43,7 +43,9 @@
#include "intprops.h"
#include "isdir.h"
#include "progname.h"
+#include "propername.h"
#include "savedir.h"
+#include "version-etc.h"
#include "xalloc.h"
#include "xstrtol.h"
@@ -53,6 +55,10 @@
#define STREQ(a, b) (strcmp (a, b) == 0)
+#define AUTHORS \
+ proper_name ("Mike Haertel"), \
+ _("others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>")
+
struct stats
{
struct stats const *parent;
@@ -2156,15 +2162,9 @@ main (int argc, char **argv)
if (show_version)
{
- printf ("%s\n\n", PACKAGE_STRING);
- printf (_("\
-Copyright (C) %s Free Software Foundation, Inc.\n\
-License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n\
-This is free software: you are free to change and redistribute it.\n\
-There is NO WARRANTY, to the extent permitted by law.\n"),
- "2009");
- printf ("\n");
- exit (EXIT_SUCCESS);
+ version_etc (stdout, program_name, PACKAGE_NAME, VERSION, AUTHORS, \
+ (char *) NULL); \
+ exit (EXIT_SUCCESS); \
}
if (show_help)