OSDN Git Service

* kill.cc (usage): Show new options. Allow specification of output stream.
authorcgf <cgf>
Mon, 13 May 2002 05:23:37 +0000 (05:23 +0000)
committercgf <cgf>
Mon, 13 May 2002 05:23:37 +0000 (05:23 +0000)
(main): Implement 'h' option.

winsup/utils/ChangeLog
winsup/utils/kill.cc

index fb3f60f..8784805 100644 (file)
@@ -1,5 +1,11 @@
 2002-05-13  Christopher Faylor  <cgf@redhat.com>
 
+       * kill.cc (usage): Show new options.  Allow specification of output
+       stream.
+       (main): Implement 'h' option.
+
+2002-05-13  Christopher Faylor  <cgf@redhat.com>
+
        * Makefile.in (kill.exe): Add as a specific target.
        * kill.cc (longopts): New.
        (opts): Ditto.
index da1721f..6c72f05 100644 (file)
@@ -32,10 +32,11 @@ static char opts[] = "hl::fs:";
 extern "C" const char *strsigno (int);
 
 static void
-usage (void)
+usage (FILE *where = stderr)
 {
-  fprintf (stderr, "Usage: kill [-sigN] pid1 [pid2 ...]\n");
-  exit (1);
+  fputs ("usage: kill [-signal] [-s signal] pid1 [pid2 ...]\n"
+        "       kill -l [signal]\n", where);
+  exit (where == stderr ? 1 : 0);
 }
 
 static int
@@ -140,6 +141,9 @@ main (int argc, char **argv)
        case 'f':
          force = 1;
          break;
+       case 'h':
+         usage (stdout);
+         break;
        case '?':
          if (gotsig)
            usage ();