- for (i = 1 ; i < argc; i++) {
- char *arg = argv[i];
- if (strcmp(arg, "--env") == 0 || strcmp(arg, "-e") == 0) {
+ static const struct option options[] = {
+ { "environment", 0, NULL, 'e' },
+ { "kernel", 0, NULL, 'k' },
+ { "udev", 0, NULL, 'u' },
+ { "help", 0, NULL, 'h' },
+ {}
+ };
+
+ while (1) {
+ option = getopt_long(argc, argv, "ekuh", options, NULL);
+ if (option == -1)
+ break;
+
+ switch (option) {
+ case 'e':