This is the mail archive of the rda@sources.redhat.com mailing list for the rda 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]

RFA: clean up usage messages


If you invoke RDA via a long path, the usage message is pretty illegible.

2004-10-12  Jim Blandy  <jimb@redhat.com>

	* server.c (usage): Don't include the entire pathname in the usage
	message.

Index: rda/unix/server.c
===================================================================
RCS file: /cvs/src/src/rda/unix/server.c,v
retrieving revision 1.8
diff -c -r1.8 server.c
*** rda/unix/server.c	7 Oct 2004 19:14:49 -0000	1.8
--- rda/unix/server.c	12 Oct 2004 23:17:56 -0000
***************
*** 250,255 ****
--- 250,259 ----
  static void
  usage (char *progname)
  {
+   /* Remove any leading slashes from the executable name.  */
+   if (strrchr (progname, '/'))
+     progname = strrchr (progname, '/') + 1;
+ 
    fprintf (stderr,
      "Usage: %s [-v] tcp-port-num executable-file [arguments ...]\n"
      "   or: %s -a [-v] tcp-port-num process-id\n"


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