diff options
author | Jim Meyering <meyering@redhat.com> | 2010-08-30 10:52:39 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2010-08-30 10:54:49 +0200 |
commit | 24037ee44d0e4c2bb22c31fe9e3747ab13caf22b (patch) | |
tree | 23f2ffa1c4d34a315975bf399e33c0989d68c9d9 | |
parent | f53baaf7a98c2fbc43eba67a760e62679c53ce50 (diff) | |
download | grep-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.
-rw-r--r-- | bootstrap.conf | 2 | ||||
-rw-r--r-- | src/main.c | 18 |
2 files changed, 11 insertions, 9 deletions
diff --git a/bootstrap.conf b/bootstrap.conf index 77870fe5..8edf429e 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -58,6 +58,7 @@ minmax obstack open progname +propername quotearg realloc regex @@ -76,6 +77,7 @@ unistd unlocked-io update-copyright useless-if-before-free +version-etc-fsf wchar wcrtomb wctob @@ -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) |