+ int force = 0;
+ const char *action = "add";
+ const char *subsystem = NULL;
+ const char *devpath = NULL;
+ struct udevice *udev;
+ struct sysfs_device *dev;
+ struct udev_rules rules = {};
+ int retval;
+ int rc = 0;
+
+ static const struct option options[] = {
+ { "action", 1, NULL, 'a' },
+ { "subsystem", 1, NULL, 's' },
+ { "force", 0, NULL, 'f' },
+ { "help", 0, NULL, 'h' },
+ {}
+ };
+
+ info("version %s\n", UDEV_VERSION);
+ udev_config_init();
+ if (udev_log_priority < LOG_INFO) {
+ char priority[32];
+
+ udev_log_priority = LOG_INFO;
+ sprintf(priority, "%i", udev_log_priority);
+ setenv("UDEV_LOG", priority, 1);
+ }
+
+ while (1) {
+ int option;
+
+ option = getopt_long(argc, argv, "a:s:fh", options, NULL);
+ if (option == -1)
+ break;
+
+ dbg("option '%c'\n", option);
+ switch (option) {
+ case 'a':
+ action = optarg;
+ break;
+ case 's':
+ subsystem = optarg;
+ break;
+ case 'f':
+ force = 1;
+ break;
+ case 'h':
+ printf("Usage: udevadm test OPTIONS <devpath>\n"
+ " --action=<string> set action string\n"
+ " --subsystem=<string> set subsystem string\n"
+ " --force don't skip node/link creation\n"
+ " --help print this help text\n\n");
+ exit(0);
+ default:
+ exit(1);
+ }
+ }
+ devpath = argv[optind];
+
+ if (devpath == NULL) {
+ fprintf(stderr, "devpath parameter missing\n");
+ rc = 1;