summaryrefslogtreecommitdiffstats
path: root/mdadm.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-01-29 14:54:55 +1100
committerNeilBrown <neilb@suse.de>2010-01-29 15:46:17 +1100
commita1331cc4068d4c0723dd46f3a170ed100adba000 (patch)
treee401e1e747df18e9e37ce47b074bd44aa2ab0940 /mdadm.c
parentc93e9d68d01fc97172c83ef9d2ee9a440db4a09d (diff)
downloadmdadm-a1331cc4068d4c0723dd46f3a170ed100adba000.tar.gz
mdadm-a1331cc4068d4c0723dd46f3a170ed100adba000.tar.xz
mdadm-a1331cc4068d4c0723dd46f3a170ed100adba000.zip
Tidy up some argument parsing, particularly for -b
-b only means --brief in MISC mode, elsewhere it is --bitmap. Resolves-debian-bug: 427777 Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/mdadm.c b/mdadm.c
index 74a39a8..d235b2a 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -151,13 +151,10 @@ int main(int argc, char *argv[])
continue;
case 'b':
- if (mode == ASSEMBLE || mode == BUILD || mode == CREATE || mode == GROW)
+ if (mode == ASSEMBLE || mode == BUILD || mode == CREATE || mode == GROW ||
+ mode == INCREMENTAL || mode == MANAGE)
break; /* b means bitmap */
brief = 1;
- if (optarg) {
- fprintf(stderr, Name ": -b cannot have any extra immediately after it, sorry.\n");
- exit(2);
- }
continue;
case 'Y': export++;
@@ -267,7 +264,8 @@ int main(int argc, char *argv[])
continue;
}
/* No mode yet, and this is the second device ... */
- fprintf(stderr, Name ": An option must be given to set the mode before a second device is listed\n");
+ fprintf(stderr, Name ": An option must be given to set the mode before a second device\n"
+ " (%s) is listed\n", optarg);
exit(2);
}
if (option_index >= 0)
@@ -874,7 +872,8 @@ int main(int argc, char *argv[])
continue;
}
/* probable typo */
- fprintf(stderr, Name ": bitmap file must contain a '/', or be 'internal', or 'none'\n");
+ fprintf(stderr, Name ": bitmap file must contain a '/', or be 'internal', or 'none'\n"
+ " not '%s'\n", optarg);
exit(2);
case O(GROW,BitmapChunk):