bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: url's in --help output


From: Sergey Poznyakoff
Subject: Re: url's in --help output
Date: Sun, 01 Feb 2009 11:31:48 +0200

Ben Asselstine <address@hidden> ha escrit:

> On Sat, Jan 31, 2009 at 5:22 PM, Karl Berry <address@hidden> wrote:
> >    The <...> markup is helpful when the URL is broken into two lines,
> >
> 
> Let's not forget about argp.  Here's a patch to sync it to the new
> format.

That would break too many existing programs. I'd rather use the attached
patch, which would not require any changes in the user code.
Although, frankly speaking, I'm not sure it is necessary, especially
given Karl's and Bruno's feedback on that subject.

Regards,
Sergey

diff --git a/lib/argp-help.c b/lib/argp-help.c
index a9843c0..7d5030e 100644
--- a/lib/argp-help.c
+++ b/lib/argp-help.c
@@ -1704,11 +1704,20 @@ Try `%s --help' or `%s --usage' for more 
information.\n"),
 
   if ((flags & ARGP_HELP_BUG_ADDR) && argp_program_bug_address)
     {
+      const char *addr = argp_program_bug_address;
+      size_t len = strlen (addr);
+      
       if (anything)
        __argp_fmtstream_putc (fs, '\n');
+
+      if (addr[0] == '<' && addr[len-1] == '>')
+       {
+         addr ++;
+         len -= 2;
+       }
       __argp_fmtstream_printf (fs, dgettext (argp->argp_domain,
-                                            "Report bugs to %s.\n"),
-                              argp_program_bug_address);
+                                            "Report bugs to <%.*s>.\n"),
+                              len, addr);
       anything = 1;
     }
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]