teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone
Blob Blame History Raw
From ed216e1ff0fdd7950b662b9ce7cbb5ca40b575a1 Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Fri, 12 Sep 2014 14:18:06 +0200
Subject: [PATCH] udev: split out help and modernise a bit

---
 src/udev/udevd.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index e54bfec3b3..f0ecbf83ef 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -997,6 +997,20 @@ static void kernel_cmdline_options(struct udev *udev) {
         }
 }
 
+static void help(void) {
+        printf("%s [OPTIONS...]\n\n"
+               "Manages devices.\n\n"
+               "  --daemon\n"
+               "  --debug\n"
+               "  --children-max=<maximum number of workers>\n"
+               "  --exec-delay=<seconds to wait before executing RUN=>\n"
+               "  --event-timeout=<seconds to wait before terminating an event>\n"
+               "  --resolve-names=early|late|never\n"
+               "  --version\n"
+               "  --help\n"
+               , program_invocation_short_name);
+}
+
 int main(int argc, char *argv[]) {
         struct udev *udev;
         sigset_t mask;
@@ -1074,16 +1088,7 @@ int main(int argc, char *argv[]) {
                         }
                         break;
                 case 'h':
-                        printf("Usage: udevd OPTIONS\n"
-                               "  --daemon\n"
-                               "  --debug\n"
-                               "  --children-max=<maximum number of workers>\n"
-                               "  --exec-delay=<seconds to wait before executing RUN=>\n"
-                               "  --event-timeout=<seconds to wait before terminating an event>\n"
-                               "  --resolve-names=early|late|never\n"
-                               "  --version\n"
-                               "  --help\n"
-                               "\n");
+                        help();
                         goto exit;
                 case 'V':
                         printf("%s\n", VERSION);