- if (!strcmp(argv[i], "NetInfo")) infosystem = INFO_NETINFO;
- else if (!strcmp(argv[i], "netinfo")) infosystem = INFO_NETINFO;
- else if (!strcmp(argv[i], "File")) infosystem = INFO_FILE;
- else if (!strcmp(argv[i], "file")) infosystem = INFO_FILE;
- else if (!strcmp(argv[i], "NIS")) infosystem = INFO_NIS;
- else if (!strcmp(argv[i], "nis")) infosystem = INFO_NIS;
- else if (!strcmp(argv[i], "YP")) infosystem = INFO_NIS;
- else if (!strcmp(argv[i], "yp")) infosystem = INFO_NIS;
- else
- {
- fprintf(stderr, "unknown info system \"%s\"\n", argv[i]);
+ while ((ch = getopt(argc, argv, "i:l:u:")) != -1)
+ switch(ch) {
+ case 'i':
+ if (!strcasecmp(optarg, "file")) {
+ infosystem = INFO_FILE;
+#ifdef INFO_NIS
+ } else if (!strcasecmp(optarg, "NIS")) {
+ infosystem = INFO_NIS;
+ } else if (!strcasecmp(optarg, "YP")) {
+ infosystem = INFO_NIS;
+#endif
+#ifdef INFO_OPEN_DIRECTORY
+ } else if (!strcasecmp(optarg, "opendirectory")) {
+ infosystem = INFO_OPEN_DIRECTORY;
+#endif
+#ifdef INFO_PAM
+ } else if (!strcasecmp(optarg, "PAM")) {
+ infosystem = INFO_PAM;
+#endif
+ } else {
+ fprintf(stderr, "%s: Unknown info system \'%s\'.\n",
+ progname, optarg);