diff options
| author | Ulrich Drepper <drepper@redhat.com> | 2009-02-06 20:13:07 +0000 |
|---|---|---|
| committer | Ulrich Drepper <drepper@redhat.com> | 2009-02-06 20:13:07 +0000 |
| commit | cbbcaf2369b2111d9388ce54ea18854319dbfab3 (patch) | |
| tree | 0ffc9cafd19065f44923eee2d1e6fac3afb114d4 | |
| parent | e2e390fad8271da33a51075cc2bf27c9fe78861b (diff) | |
| download | glibc-cbbcaf2369b2111d9388ce54ea18854319dbfab3.tar.xz glibc-cbbcaf2369b2111d9388ce54ea18854319dbfab3.zip | |
* debug/xtrace.sh: Unify translatable messages.
* elf/ldd.bash.in: Likewise.
* elf/sprof.c: Likewise.
* locale/programs/locale.c: Likewise.
* malloc/memusage.sh: Likewise.
* nss/getent.c: Likewise.
2009-02-06 Joseph Myers <joseph@codesourcery.com>
* debug/pcprofiledump.c (print_version,
argp_program_version_hook): New function.
* elf/ldconfig.c (more_help): New function.
(argp): Use it.
* elf/sln.c (usage): New function.
(main): Support --help and --version.
* malloc/memusagestat.c (print_version): New function.
(argp_program_version_hook): New variable.
* nscd/nscd.c (more_help): New function.
(argp): Use it.
* posix/getconf.c (main): Send --version output to stdout.
Support --help.
* sunrpc/rpc_main.c (usage, options_usage): Take STREAM and STATUS
arguments. All callers changed.
(print_version): New function.
(parseargs): Support --help and --version.
* sunrpc/rpcinfo.c (usage): Take STREAM argument. All callers
changed.
(print_version): New function.
(main): Use getopt_long. Support --help and --version.
* sysdeps/unix/sysv/linux/lddlibc4.c (main): Support --help and
--version.
2009-02-06 Ulrich Drepper <drepper@redhat.com>
| -rw-r--r-- | ChangeLog | 34 | ||||
| -rw-r--r-- | debug/pcprofiledump.c | 19 | ||||
| -rwxr-xr-x | debug/xtrace.sh | 6 | ||||
| -rw-r--r-- | elf/ldconfig.c | 22 | ||||
| -rw-r--r-- | elf/ldd.bash.in | 6 | ||||
| -rw-r--r-- | elf/sln.c | 52 | ||||
| -rw-r--r-- | elf/sprof.c | 28 | ||||
| -rw-r--r-- | locale/programs/locale.c | 26 | ||||
| -rwxr-xr-x | malloc/memusage.sh | 6 | ||||
| -rw-r--r-- | malloc/memusagestat.c | 22 | ||||
| -rw-r--r-- | nscd/nscd.c | 22 | ||||
| -rw-r--r-- | nss/getent.c | 10 | ||||
| -rw-r--r-- | po/libc.pot | 1133 | ||||
| -rw-r--r-- | posix/getconf.c | 20 | ||||
| -rw-r--r-- | sunrpc/rpc_main.c | 96 | ||||
| -rw-r--r-- | sunrpc/rpcinfo.c | 59 | ||||
| -rw-r--r-- | sysdeps/unix/sysv/linux/lddlibc4.c | 20 |
17 files changed, 1008 insertions, 573 deletions
@@ -1,5 +1,39 @@ 2009-02-06 Ulrich Drepper <drepper@redhat.com> + * debug/xtrace.sh: Unify translatable messages. + * elf/ldd.bash.in: Likewise. + * elf/sprof.c: Likewise. + * locale/programs/locale.c: Likewise. + * malloc/memusage.sh: Likewise. + * nss/getent.c: Likewise. + +2009-02-06 Joseph Myers <joseph@codesourcery.com> + + * debug/pcprofiledump.c (print_version, + argp_program_version_hook): New function. + * elf/ldconfig.c (more_help): New function. + (argp): Use it. + * elf/sln.c (usage): New function. + (main): Support --help and --version. + * malloc/memusagestat.c (print_version): New function. + (argp_program_version_hook): New variable. + * nscd/nscd.c (more_help): New function. + (argp): Use it. + * posix/getconf.c (main): Send --version output to stdout. + Support --help. + * sunrpc/rpc_main.c (usage, options_usage): Take STREAM and STATUS + arguments. All callers changed. + (print_version): New function. + (parseargs): Support --help and --version. + * sunrpc/rpcinfo.c (usage): Take STREAM argument. All callers + changed. + (print_version): New function. + (main): Use getopt_long. Support --help and --version. + * sysdeps/unix/sysv/linux/lddlibc4.c (main): Support --help and + --version. + +2009-02-06 Ulrich Drepper <drepper@redhat.com> + * malloc/memusage.c (DEFAULT_BUFFER_SIZE): Change to 32768. (update_data): Fix handling of wrapping back to the beginning of the buffer. diff --git a/debug/pcprofiledump.c b/debug/pcprofiledump.c index 62c0d73f40..13d9e8c34c 100644 --- a/debug/pcprofiledump.c +++ b/debug/pcprofiledump.c @@ -1,5 +1,5 @@ /* Dump information generated by PC profiling. - Copyright (C) 1999, 2002, 2007 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2007, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999. @@ -66,6 +66,10 @@ static char *more_help (int key, const char *text, void *input); /* Prototype for option handler. */ static error_t parse_opt (int key, char *arg, struct argp_state *state); +/* Name and version of program. */ +static void print_version (FILE *stream, struct argp_state *state); +void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; + /* Data structure to communicate with argp functions. */ static struct argp argp = { @@ -209,3 +213,16 @@ For bug reporting instructions, please see:\n\ } return (char *) text; } + +/* Print the version information. */ +static void +print_version (FILE *stream, struct argp_state *state) +{ + fprintf (stream, "pcprofiledump (GNU %s) %s\n", PACKAGE, VERSION); + fprintf (stream, gettext ("\ +Copyright (C) %s Free Software Foundation, Inc.\n\ +This is free software; see the source for copying conditions. There is NO\n\ +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ +"), "2009"); + fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper"); +} diff --git a/debug/xtrace.sh b/debug/xtrace.sh index ef0188afde..e3b9daa433 100755 --- a/debug/xtrace.sh +++ b/debug/xtrace.sh @@ -54,8 +54,10 @@ do_help() { Mandatory arguments to long options are also mandatory for any corresponding short options. -For bug reporting instructions, please see: -<http://www.gnu.org/software/libc/bugs.html>.\n" +" + printf $"For bug reporting instructions, please see: +<http://www.gnu.org/software/libc/bugs.html>. +" exit 0 } diff --git a/elf/ldconfig.c b/elf/ldconfig.c index d7ad8c8812..78a0f0c2a8 100644 --- a/elf/ldconfig.c +++ b/elf/ldconfig.c @@ -132,6 +132,9 @@ static void print_version (FILE *stream, struct argp_state *state); void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; +/* Function to print some extra text in the help message. */ +static char *more_help (int key, const char *text, void *input); + /* Definitions of arguments for argp functions. */ static const struct argp_option options[] = { @@ -161,7 +164,7 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state); /* Data structure to communicate with argp functions. */ static struct argp argp = { - options, parse_opt, NULL, doc, NULL, NULL, NULL + options, parse_opt, NULL, doc, NULL, more_help, NULL }; /* Check if string corresponds to an important hardware capability or @@ -288,6 +291,23 @@ parse_opt (int key, char *arg, struct argp_state *state) return 0; } +/* Print bug-reporting information in the help message. */ +static char * +more_help (int key, const char *text, void *input) +{ + switch (key) + { + case ARGP_KEY_HELP_EXTRA: + /* We print some extra information. */ + return strdup (gettext ("\ +For bug reporting instructions, please see:\n\ +<http://www.gnu.org/software/libc/bugs.html>.\n")); + default: + break; + } + return (char *) text; +} + /* Print the version information. */ static void print_version (FILE *stream, struct argp_state *state) diff --git a/elf/ldd.bash.in b/elf/ldd.bash.in index ffd125dadf..1bbefe2ff0 100644 --- a/elf/ldd.bash.in +++ b/elf/ldd.bash.in @@ -52,8 +52,10 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -r, --function-relocs process data and function relocations -u, --unused print unused direct dependencies -v, --verbose print all information -For bug reporting instructions, please see: -<http://www.gnu.org/software/libc/bugs.html>." +" + echo $"For bug reporting instructions, please see: +<http://www.gnu.org/software/libc/bugs.html>. +" exit 0 ;; -d | --d | --da | --dat | --data | --data- | --data-r | --data-re | \ @@ -1,5 +1,5 @@ /* `sln' program to create symbolic links between files. - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2001, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,9 +16,15 @@ License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ - + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include <error.h> #include <errno.h> +#include <libintl.h> +#include <locale.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> @@ -28,19 +34,37 @@ #include <string.h> #include <limits.h> +#include "../version.h" + +#define PACKAGE _libc_intl_domainname + #if !defined S_ISDIR && defined S_IFDIR #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif static int makesymlink (const char *src, const char *dest); static int makesymlinks (const char *file); +static void usage (void); int main (int argc, char **argv) { + /* Set locale via LC_ALL. */ + setlocale (LC_ALL, ""); + + /* Set the text message domain. */ + textdomain (PACKAGE); + switch (argc) { case 2: + if (strcmp (argv[1], "--version") == 0) { + printf ("sln (GNU libc) %s\n", VERSION); + return 0; + } else if (strcmp (argv[1], "--help") == 0) { + usage (); + return 0; + } return makesymlinks (argv [1]); break; @@ -49,12 +73,20 @@ main (int argc, char **argv) break; default: - printf ("Usage: %s src dest|file\n", argv [0]); + usage (); return 1; break; } } +static void +usage (void) +{ + printf (_("Usage: sln src dest|file\n\n")); + printf (_("For bug reporting instructions, please see:\n\ +<http://www.gnu.org/software/libc/bugs.html>.\n")); +} + static int makesymlinks (file) const char *file; @@ -75,7 +107,7 @@ makesymlinks (file) fp = fopen (file, "r"); if (fp == NULL) { - fprintf (stderr, "%s: file open error: %m\n", file); + fprintf (stderr, _("%s: file open error: %m\n"), file); return 1; } } @@ -112,7 +144,7 @@ makesymlinks (file) ++cp; if (*cp == '\0') { - fprintf (stderr, "No target in line %d\n", lineno); + fprintf (stderr, _("No target in line %d\n"), lineno); ret = 1; continue; } @@ -144,13 +176,13 @@ makesymlink (src, dest) { if (S_ISDIR (stats.st_mode)) { - fprintf (stderr, "%s: destination must not be a directory\n", + fprintf (stderr, _("%s: destination must not be a directory\n"), dest); return 1; } else if (unlink (dest) && errno != ENOENT) { - fprintf (stderr, "%s: failed to remove the old destination\n", + fprintf (stderr, _("%s: failed to remove the old destination\n"), dest); return 1; } @@ -158,7 +190,7 @@ makesymlink (src, dest) else if (errno != ENOENT) { error = strerror (errno); - fprintf (stderr, "%s: invalid destination: %s\n", dest, error); + fprintf (stderr, _("%s: invalid destination: %s\n"), dest, error); return -1; } @@ -173,7 +205,7 @@ makesymlink (src, dest) { error = strerror (errno); unlink (dest); - fprintf (stderr, "Invalid link from \"%s\" to \"%s\": %s\n", + fprintf (stderr, _("Invalid link from \"%s\" to \"%s\": %s\n"), src, dest, error); return 1; } @@ -182,7 +214,7 @@ makesymlink (src, dest) else { error = strerror (errno); - fprintf (stderr, "Invalid link from \"%s\" to \"%s\": %s\n", + fprintf (stderr, _("Invalid link from \"%s\" to \"%s\": %s\n"), src, dest, error); return 1; } diff --git a/elf/sprof.c b/elf/sprof.c index 4244e05c38..ad723f3416 100644 --- a/elf/sprof.c +++ b/elf/sprof.c @@ -86,9 +86,9 @@ static const struct argp_option options[] = }; /* Short description of program. */ -static const char doc[] = N_("Read and display shared object profiling data.\v\ -For bug reporting instructions, please see:\n\ -<http://www.gnu.org/software/libc/bugs.html>.\n"); +static const char doc[] = N_("Read and display shared object profiling data."); +//For bug reporting instructions, please see:\n \ +//<http://www.gnu.org/software/libc/bugs.html>.\n"); /* Strings for arguments in help texts. */ static const char args_doc[] = N_("SHOBJ [PROFDATA]"); @@ -96,10 +96,13 @@ static const char args_doc[] = N_("SHOBJ [PROFDATA]"); /* Prototype for option handler. */ static error_t parse_opt (int key, char *arg, struct argp_state *state); +/* Function to print some extra text in the help message. */ +static char *more_help (int key, const char *text, void *input); + /* Data structure to communicate with argp functions. */ static struct argp argp = { - options, parse_opt, args_doc, doc + options, parse_opt, args_doc, doc, NULL, more_help }; @@ -347,6 +350,23 @@ parse_opt (int key, char *arg, struct argp_state *state) } +static char * +more_help (int key, const char *text, void *input) +{ + switch (key) + { + case ARGP_KEY_HELP_EXTRA: + /* We print some extra information. */ + return strdup (gettext ("\ +For bug reporting instructions, please see:\n\ +<http://www.gnu.org/software/libc/bugs.html>.\n")); + default: + break; + } + return (char *) text; +} + + /* Print the version information. */ static void print_version (FILE *stream, struct argp_state *state) diff --git a/locale/programs/locale.c b/locale/programs/locale.c index 33963d5b25..77262b7d1c 100644 --- a/locale/programs/locale.c +++ b/locale/programs/locale.c @@ -84,9 +84,7 @@ static const struct argp_option options[] = }; /* Short description of program. */ -static const char doc[] = N_("Get locale-specific information.\v\ -For bug reporting instructions, please see:\n\ -<http://www.gnu.org/software/libc/bugs.html>.\n"); +static const char doc[] = N_("Get locale-specific information."); /* Strings for arguments in help texts. */ static const char args_doc[] = N_("NAME\n[-a|-m]"); @@ -94,10 +92,13 @@ static const char args_doc[] = N_("NAME\n[-a|-m]"); /* Prototype for option handler. */ static error_t parse_opt (int key, char *arg, struct argp_state *state); +/* Function to print some extra text in the help message. */ +static char *more_help (int key, const char *text, void *input); + /* Data structure to communicate with argp functions. */ static struct argp argp = { - options, parse_opt, args_doc, doc + options, parse_opt, args_doc, doc, NULL, more_help }; @@ -267,6 +268,23 @@ parse_opt (int key, char *arg, struct argp_state *state) } +static char * +more_help (int key, const char *text, void *input) +{ + switch (key) + { + case ARGP_KEY_HELP_EXTRA: + /* We print some extra information. */ + return strdup (gettext ("\ +For bug reporting instructions, please see:\n\ +<http://www.gnu.org/software/libc/bugs.html>.\n")); + default: + break; + } + return (char *) text; +} + + /* Print the version information. */ static void print_version (FILE *stream, struct argp_state *state) diff --git a/malloc/memusage.sh b/malloc/memusage.sh index 1c906a1be5..8b372e4b8e 100755 --- a/malloc/memusage.sh +++ b/malloc/memusage.sh @@ -61,8 +61,10 @@ Profile memory usage of PROGRAM. Mandatory arguments to long options are also mandatory for any corresponding short options. -For bug reporting instructions, please see: -<http://www.gnu.org/software/libc/bugs.html>." +" + print $"For bug reporting instructions, please see: +<http://www.gnu.org/software/libc/bugs.html>. +" exit 0 } diff --git a/malloc/memusagestat.c b/malloc/memusagestat.c index 779d5c0a59..bf33175415 100644 --- a/malloc/memusagestat.c +++ b/malloc/memusagestat.c @@ -1,5 +1,6 @@ /* Generate graphic from memory profiling data. - Copyright (C) 1998, 1999, 2000, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2005, 2006, + 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. @@ -38,6 +39,8 @@ #include <gdfontl.h> #include <gdfonts.h> +#include "../version.h" +#define PACKAGE _libc_intl_domainname /* Default size of the generated image. */ #define XSIZE 800 @@ -73,6 +76,10 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state); /* Function to print some extra text in the help message. */ static char *more_help (int key, const char *text, void *input); +/* Name and version of program. */ +static void print_version (FILE *stream, struct argp_state *state); +void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; + /* Data structure to communicate with argp functions. */ static struct argp argp = { @@ -535,3 +542,16 @@ For bug reporting instructions, please see:\n\ } return (char *) text; } + +/* Print the version information. */ +static void +print_version (FILE *stream, struct argp_state *state) +{ + fprintf (stream, "memusagestat (GNU %s) %s\n", PACKAGE, VERSION); + fprintf (stream, gettext ("\ +Copyright (C) %s Free Software Foundation, Inc.\n\ +This is free software; see the source for copying conditions. There is NO\n\ +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ +"), "2009"); + fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper"); +} diff --git a/nscd/nscd.c b/nscd/nscd.c index 1129cf8480..3265ea8973 100644 --- a/nscd/nscd.c +++ b/nscd/nscd.c @@ -91,6 +91,9 @@ static int write_pid (const char *file); static void print_version (FILE *stream, struct argp_state *state); void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; +/* Function to print some extra text in the help message. */ +static char *more_help (int key, const char *text, void *input); + /* Definitions of arguments for argp functions. */ static const struct argp_option options[] = { @@ -117,7 +120,7 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state); /* Data structure to communicate with argp functions. */ static struct argp argp = { - options, parse_opt, NULL, doc, + options, parse_opt, NULL, doc, NULL, more_help }; /* True if only statistics are requested. */ @@ -401,6 +404,23 @@ parse_opt (int key, char *arg, struct argp_state *state) return 0; } +/* Print bug-reporting information in the help message. */ +static char * +more_help (int key, const char *text, void *input) +{ + switch (key) + { + case ARGP_KEY_HELP_EXTRA: + /* We print some extra information. */ + return strdup (gettext ("\ +For bug reporting instructions, please see:\n\ +<http://www.gnu.org/software/libc/bugs.html>.\n")); + default: + break; + } + return (char *) text; +} + /* Print the version information. */ static void print_version (FILE *stream, struct argp_state *state) diff --git a/nss/getent.c b/nss/getent.c index 7a3ad52175..ea5608f1e2 100644 --- a/nss/getent.c +++ b/nss/getent.c @@ -59,9 +59,7 @@ static const struct argp_option args_options[] = }; /* Short description of program. */ -static const char doc[] = N_("Get entries from administrative database.\v\ -For bug reporting instructions, please see:\n\ -<http://www.gnu.org/software/libc/bugs.html>.\n"); +static const char doc[] = N_("Get entries from administrative database."); /* Prototype for option handler. */ static error_t parse_option (int key, char *arg, struct argp_state *state); @@ -839,6 +837,12 @@ more_help (int key, const char *text, void *input) col += len + 1; } + fputs ("\n\n", fp); + + fprintf (fp, gettext ("\ +For bug reporting instructions, please see:\n\ +<http://www.gnu.org/software/libc/bugs.html>.\n")); + if (fclose (fp) == 0) return doc; } |
