chiark / gitweb /
add "static" back to the inline functions
[elogind.git] / udev / udevadm-trigger.c
index 8d25f923995bfa66733c4bddc41cc2e05c935cf1..15e7dc17fb88d7b0da4e20f3a6946063d9012983 100644 (file)
@@ -79,16 +79,16 @@ static int scan_failed(struct udev_enumerate *udev_enumerate)
 int udevadm_trigger(struct udev *udev, int argc, char *argv[])
 {
        static const struct option options[] = {
-               { "verbose", 0, NULL, 'v' },
-               { "dry-run", 0, NULL, 'n' },
-               { "type", 1, NULL, 't' },
-               { "retry-failed", 0, NULL, 'F' },
-               { "action", 1, NULL, 'c' },
-               { "subsystem-match", 1, NULL, 's' },
-               { "subsystem-nomatch", 1, NULL, 'S' },
-               { "attr-match", 1, NULL, 'a' },
-               { "attr-nomatch", 1, NULL, 'A' },
-               { "help", 0, NULL, 'h' },
+               { "verbose", no_argument, NULL, 'v' },
+               { "dry-run", no_argument, NULL, 'n' },
+               { "type", required_argument, NULL, 't' },
+               { "retry-failed", no_argument, NULL, 'F' },
+               { "action", required_argument, NULL, 'c' },
+               { "subsystem-match", required_argument, NULL, 's' },
+               { "subsystem-nomatch", required_argument, NULL, 'S' },
+               { "attr-match", required_argument, NULL, 'a' },
+               { "attr-nomatch", required_argument, NULL, 'A' },
+               { "help", no_argument, NULL, 'h' },
                {}
        };
        enum {
@@ -156,7 +156,7 @@ int udevadm_trigger(struct udev *udev, int argc, char *argv[])
                                val[0] = 0;
                                val = &val[1];
                        }
-                       udev_enumerate_add_match_attr(udev_enumerate, attr, val);
+                       udev_enumerate_add_match_sysattr(udev_enumerate, attr, val);
                        break;
                case 'A':
                        util_strlcpy(attr, optarg, sizeof(attr));
@@ -165,23 +165,23 @@ int udevadm_trigger(struct udev *udev, int argc, char *argv[])
                                val[0] = 0;
                                val = &val[1];
                        }
-                       udev_enumerate_add_nomatch_attr(udev_enumerate, attr, val);
+                       udev_enumerate_add_nomatch_sysattr(udev_enumerate, attr, val);
                        break;
                case 'h':
                        printf("Usage: udevadm trigger OPTIONS\n"
                               "  --verbose                       print the list of devices while running\n"
                               "  --dry-run                       do not actually trigger the events\n"
                               "  --type=                         type of events to trigger\n"
-                              "      devices                       sys devices\n"
+                              "      devices                       sys devices (default)\n"
                               "      subsystems                    sys subsystems and drivers\n"
                               "      failed                        trigger only the events which have been\n"
                               "                                    marked as failed during a previous run\n"
+                              "  --action=<action>               event action value, default is \"add\"\n"
                               "  --subsystem-match=<subsystem>   trigger devices from a matching subystem\n"
                               "  --subsystem-nomatch=<subsystem> exclude devices from a matching subystem\n"
                               "  --attr-match=<file[=<value>]>   trigger devices with a matching attribute\n"
                               "  --attr-nomatch=<file[=<value>]> exclude devices with a matching attribute\n"
-                              "  --help                          print this text\n"
-                              "\n");
+                              "  --help\n\n");
                        goto exit;
                default:
                        goto exit;