- struct sysfs_class_device *class_dev;
- char *devpath;
- char path[SYSFS_PATH_MAX];
- char temp[NAME_SIZE];
- char *subsystem = "";
- struct udevice udev;
-
- main_argv = argv;
- main_envp = envp;
-
- info("version %s", UDEV_VERSION);
-
- if (argv[1] == NULL) {
- info("udevinfo expects the DEVPATH of the sysfs device as a argument");
- return 1;
+ 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);