- static struct option long_opt[] = {
- {"backfstype", 1, 0, 'b'},
- {"stripe-count-hint", 1, 0, 'c'},
- {"comment", 1, 0, 'u'},
- {"configdev", 1, 0, 'C'},
- {"device-size", 1, 0, 'd'},
- {"dryrun", 0, 0, 'n'},
- {"erase-params", 0, 0, 'e'},
- {"failnode", 1, 0, 'f'},
- {"failover", 1, 0, 'f'},
- {"mgs", 0, 0, 'G'},
- {"help", 0, 0, 'h'},
- {"index", 1, 0, 'i'},
- {"mkfsoptions", 1, 0, 'k'},
- {"mgsnode", 1, 0, 'm'},
- {"mgsnid", 1, 0, 'm'},
- {"mdt", 0, 0, 'M'},
- {"fsname",1, 0, 'L'},
- {"noformat", 0, 0, 'n'},
- {"nomgs", 0, 0, 'N'},
- {"mountfsoptions", 1, 0, 'o'},
- {"ost", 0, 0, 'O'},
- {"param", 1, 0, 'p'},
- {"print", 0, 0, 'n'},
- {"quiet", 0, 0, 'q'},
- {"reformat", 0, 0, 'r'},
- {"servicenode", 1, 0, 's'},
- {"verbose", 0, 0, 'v'},
- {"writeconf", 0, 0, 'w'},
- {"upgrade_to_18", 0, 0, 'U'},
- {"network", 1, 0, 't'},
- {"quota", 0, 0, 'Q'},
- {0, 0, 0, 0}
- };
- char *optstring = "b:c:C:d:ef:Ghi:k:L:m:MnNo:Op:Pqrs:t:Uu:vw";
- int opt;
- int rc, longidx;
- int failnode_set = 0, servicenode_set = 0;
+ static struct option long_opt[] = {
+ { "backfstype", required_argument, NULL, 'b' },
+ { "stripe-count-hint", required_argument, NULL, 'c' },
+ { "comment", required_argument, NULL, 'u' },
+ { "configdev", required_argument, NULL, 'C' },
+ { "device-size", required_argument, NULL, 'd' },
+ { "dryrun", no_argument, NULL, 'n' },
+ { "erase-params", no_argument, NULL, 'e' },
+ { "failnode", required_argument, NULL, 'f' },
+ { "failover", required_argument, NULL, 'f' },
+ { "mgs", no_argument, NULL, 'G' },
+ { "help", no_argument, NULL, 'h' },
+ { "index", required_argument, NULL, 'i' },
+ { "mkfsoptions", required_argument, NULL, 'k' },
+ { "mgsnode", required_argument, NULL, 'm' },
+ { "mgsnid", required_argument, NULL, 'm' },
+ { "mdt", no_argument, NULL, 'M' },
+ { "fsname", required_argument, NULL, 'L' },
+ { "noformat", no_argument, NULL, 'n' },
+ { "nomgs", no_argument, NULL, 'N' },
+ { "mountfsoptions", required_argument, NULL, 'o' },
+ { "ost", no_argument, NULL, 'O' },
+ { "param", required_argument, NULL, 'p' },
+ { "print", no_argument, NULL, 'n' },
+ { "quiet", no_argument, NULL, 'q' },
+ { "quota", no_argument, NULL, 'Q' },
+ { "reformat", no_argument, NULL, 'r' },
+ { "replace", no_argument, NULL, 'R' },
+ { "servicenode", required_argument, NULL, 's' },
+ { "network", required_argument, NULL, 't' },
+ { "verbose", no_argument, NULL, 'v' },
+ { "writeconf", no_argument, NULL, 'w' },
+ { 0, 0, NULL, 0 }
+ };
+ char *optstring = "b:c:C:d:ef:Ghi:k:L:m:MnNo:Op:PqrRs:t:Uu:vw";
+ int opt;
+ int rc, longidx;
+ int failnode_set = 0, servicenode_set = 0;
+ int replace = 0;