This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [...] deprecated use of "\v"


Benno Schulenberg wrote:
> At several places libc's code does the right thing, and separates
> those two sentences.

Attached patch separates the docstring from the extra help text also 
for 'gencat', 'getent', 'locale', and 'sprof'.

Regards,

Benno
diff -ur cvs-libc/catgets/gencat.c libc-new/catgets/gencat.c
--- cvs-libc/catgets/gencat.c	2007-07-21 00:34:31.000000000 +0200
+++ libc-new/catgets/gencat.c	2007-08-15 12:34:51.000000000 +0200
@@ -116,9 +116,7 @@
 };
 
 /* Short description of program.  */
-static const char doc[] = N_("Generate message catalog.\
-\vIf INPUT-FILE is -, input is read from standard input.  If OUTPUT-FILE\n\
-is -, output is written to standard output.\n");
+static const char doc[] = N_("Generate message catalog.");
 
 /* Strings for arguments in help texts.  */
 static const char args_doc[] = N_("\
@@ -225,13 +223,20 @@
 static char *
 more_help (int key, const char *text, void *input)
 {
+  char *cp;
+
   switch (key)
     {
     case ARGP_KEY_HELP_EXTRA:
       /* We print some extra information.  */
-      return strdup (gettext ("\
+      asprintf (&cp, gettext ("\
+If INPUT-FILE is -, input is read from standard input.\n\
+If OUTPUT-FILE is -, output is written to standard output.\n\n\
+%s"),
+		gettext ("\
 For bug reporting instructions, please see:\n\
 <http://www.gnu.org/software/libc/bugs.html>.\n"));
+      return cp;
     default:
       break;
     }
diff -ur cvs-libc/elf/sprof.c libc-new/elf/sprof.c
--- cvs-libc/elf/sprof.c	2007-02-10 00:14:26.000000000 +0100
+++ libc-new/elf/sprof.c	2007-08-15 12:08:35.000000000 +0200
@@ -86,9 +86,7 @@
 };
 
 /* 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.");
 
 /* Strings for arguments in help texts.  */
 static const char args_doc[] = N_("SHOBJ [PROFDATA]");
@@ -96,10 +94,13 @@
 /* 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 +348,22 @@
 }
 
 
+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 -ur cvs-libc/locale/programs/locale.c libc-new/locale/programs/locale.c
--- cvs-libc/locale/programs/locale.c	2007-07-21 00:34:33.000000000 +0200
+++ libc-new/locale/programs/locale.c	2007-08-15 12:12:00.000000000 +0200
@@ -84,9 +84,7 @@
 };
 
 /* 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 @@
 /* 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,22 @@
 }
 
 
+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 -ur cvs-libc/nss/getent.c libc-new/nss/getent.c
--- cvs-libc/nss/getent.c	2007-02-10 00:14:29.000000000 +0100
+++ libc-new/nss/getent.c	2007-08-15 12:18:58.000000000 +0200
@@ -59,9 +59,7 @@
   };
 
 /* 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);
@@ -805,6 +803,11 @@
       fp = open_memstream (&doc, &len);
       if (fp != NULL)
 	{
+	  fputs_unlocked (_("\
+For bug reporting instructions, please see:\n\
+<http://www.gnu.org/software/libc/bugs.html>.\n"), fp);
+	  fputc_unlocked ('\n', fp);
+
 	  fputs_unlocked (_("Supported databases:\n"), fp);
 
 	  for (int i = 0, col = 0; databases[i].name != NULL; ++i)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]