-#ifndef SCSI_ID_VERSION
-#warning No version
-#define SCSI_ID_VERSION "unknown"
-#endif
-
-/*
- * temporary names for mknod.
- */
-#define TMP_DIR "/tmp"
-#define TMP_PREFIX "scsi"
-
-static const char short_options[] = "bc:d:ef:gip:s:vV";
-/*
- * Just duplicate per dev options.
- */
-static const char dev_short_options[] = "bc:gp:";
-
-char sysfs_mnt_path[SYSFS_PATH_MAX];
+/* temporary names for mknod */
+#define TMP_DIR "/dev"
+#define TMP_PREFIX "tmp-scsi"
+
+static const struct option options[] = {
+ { "device", 1, NULL, 'd' },
+ { "config", 1, NULL, 'f' },
+ { "page", 1, NULL, 'p' },
+ { "devpath", 1, NULL, 's' },
+ { "fallback-to-sysfs", 0, NULL, 'a' },
+ { "blacklisted", 0, NULL, 'b' },
+ { "whitelisted", 0, NULL, 'g' },
+ { "prefix-bus-id", 0, NULL, 'i' },
+ { "replace-whitespace", 0, NULL, 'u' },
+ { "ignore-sysfs", 0, NULL, 'n' },
+ { "verbose", 0, NULL, 'v' },
+ { "version", 0, NULL, 'V' },
+ { "export", 0, NULL, 'x' },
+ { "help", 0, NULL, 'h' },
+ {}
+};
+
+static const char short_options[] = "abd:f:ghinp:s:uvVx";
+static const char dev_short_options[] = "bgp:";