]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/udev/udevadm-settle.c
resolved: don't check conflicts for DNS-SD enumeration RRs
[thirdparty/systemd.git] / src / udev / udevadm-settle.c
index 3d6ca7a98589342c36fc3e9a7e5d37b8e6c14df0..0af3e6412b0c72d3be977edd67e8575dfbae221f 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright (C) 2006-2009 Kay Sievers <kay@vrfy.org>
  * Copyright (C) 2009 Canonical Ltd.
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <stdlib.h>
-#include <stddef.h>
-#include <string.h>
-#include <stdio.h>
-#include <unistd.h>
 #include <errno.h>
 #include <getopt.h>
 #include <poll.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 
+#include "parse-util.h"
 #include "udev.h"
+#include "udevadm-util.h"
 #include "util.h"
 
 static void help(void) {
-        printf("%s settle OPTIONS\n\n"
+        printf("%s settle [OPTIONS]\n\n"
                "Wait for pending udev events.\n\n"
                "  -h --help                 Show this help\n"
-               "     --version              Show package version\n"
+               "  -V --version              Show package version\n"
                "  -t --timeout=SECONDS      Maximum time to wait for events\n"
                "  -E --exit-if-exists=FILE  Stop waiting if file exists\n"
                , program_invocation_short_name);
@@ -43,6 +46,7 @@ static int adm_settle(struct udev *udev, int argc, char *argv[]) {
         static const struct option options[] = {
                 { "timeout",        required_argument, NULL, 't' },
                 { "exit-if-exists", required_argument, NULL, 'E' },
+                { "version",        no_argument,       NULL, 'V' },
                 { "help",           no_argument,       NULL, 'h' },
                 { "seq-start",      required_argument, NULL, 's' }, /* removed */
                 { "seq-end",        required_argument, NULL, 'e' }, /* removed */
@@ -57,7 +61,7 @@ static int adm_settle(struct udev *udev, int argc, char *argv[]) {
         struct udev_queue *queue;
         int rc = EXIT_FAILURE;
 
-        while ((c = getopt_long(argc, argv, "t:E:hs:e:q", options, NULL)) >= 0) {
+        while ((c = getopt_long(argc, argv, "t:E:Vhs:e:q", options, NULL)) >= 0) {
                 switch (c) {
 
                 case 't': {
@@ -75,6 +79,10 @@ static int adm_settle(struct udev *udev, int argc, char *argv[]) {
                         exists = optarg;
                         break;
 
+                case 'V':
+                        print_version();
+                        return EXIT_SUCCESS;
+
                 case 'h':
                         help();
                         return EXIT_SUCCESS;