- if (optarg == NULL)
- autof = -2;
- else if (strcasecmp(optarg,"no")==0)
- autof = 0;
- else if (strcasecmp(optarg,"yes")==0)
- autof = -2;
- else if (strcasecmp(optarg,"md")==0)
- autof = -1;
- else {
- /* There might be digits, and maybe a hypen, at the end */
- char *e = optarg + strlen(optarg);
- int num = 4;
- int len;
- while (e > optarg && isdigit(e[-1]))
- e--;
- if (*e) {
- num = atoi(e);
- if (num <= 0) num = 1;
- }
- if (e > optarg && e[-1] == '-')
- e--;
- len = e - optarg;
- if ((len == 3 && strncasecmp(optarg,"mdp",3)==0) ||
- (len == 1 && strncasecmp(optarg,"p",1)==0) ||
- (len >= 4 && strncasecmp(optarg,"part",4)==0))
- autof = num;
- else {
- fprintf(stderr, Name ": --auto flag arg of \"%s\" unrecognised: use no,yes,md,mdp,part\n"
- " optionally followed by a number.\n",
- optarg);
- exit(2);
- }
- }
+ autof = parse_auto(optarg, "--auto flag", 0);
+ continue;
+
+ case O(CREATE,Symlinks):
+ case O(BUILD,Symlinks):
+ case O(ASSEMBLE,Symlinks): /* auto creation of symlinks in /dev to /dev/md */
+ symlinks = optarg;