summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-10-23 08:56:27 +1000
committerNeil Brown <neilb@suse.de>2006-10-23 08:56:27 +1000
commitcbfbcb0b503752a560e607039924f3192fde314b (patch)
tree9088c00bc03172599c0116f7d57aeabff2ecdcd0
parent1746711680e1b1790bc6c482b63933385a7ee505 (diff)
downloadmdadm-cbfbcb0b503752a560e607039924f3192fde314b.tar.gz
mdadm-cbfbcb0b503752a560e607039924f3192fde314b.tar.xz
mdadm-cbfbcb0b503752a560e607039924f3192fde314b.zip
Improve error message when wrong --update option is given.
-rw-r--r--ChangeLog1
-rw-r--r--ReadMe.c4
-rw-r--r--mdadm.c8
3 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 1aaa1ee..7cb07fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,7 @@ Changes Prior to this release
- When --assemble --scan is run, if all arrays that could be found
have already been started, don't report an error.
- Fix a couple of bugs related to raid10 and the new 'offset' layout.
+ - Improve error message when a wrong '--update' option is given.
Changes Prior to 2.5.4 release
- When creating devices in /dev/md/ create matching symlinks
diff --git a/ReadMe.c b/ReadMe.c
index 5704423..2a352ef 100644
--- a/ReadMe.c
+++ b/ReadMe.c
@@ -272,7 +272,7 @@ char OptionHelp[] =
" --config= -c : config file\n"
" --scan -s : scan config file for missing information\n"
" --force -f : Assemble the array even if some superblocks appear out-of-date\n"
-" --update= -U : Update superblock: one of sparc2.2, super-minor or summaries\n"
+" --update= -U : Update superblock: try '-A --update=?' for list of options.\n"
" --auto(=p) -a : Automatically allocate new (partitioned) md array if needed.\n"
" --no-degraded : Do not start any degraded arrays - default unless --scan.\n"
"\n"
@@ -414,7 +414,7 @@ char Help_assemble[] =
" for a full array are present\n"
" --force -f : Assemble the array even if some superblocks appear\n"
" : out-of-date. This involves modifying the superblocks.\n"
-" --update= -U : Update superblock: one of sparc2.2, super-minor or summaries\n"
+" --update= -U : Update superblock: try '-A --update=?' for option list.\n"
" --no-degraded : Assemble but do not start degraded arrays.\n"
;
diff --git a/mdadm.c b/mdadm.c
index 00514a6..41e6c4c 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -596,7 +596,13 @@ int main(int argc, char *argv[])
continue;
}
- fprintf(stderr, Name ": '--update %s' invalid. Only 'sparc2.2', 'super-minor', 'uuid', 'resync' or 'summaries' supported\n",update);
+ if (strcmp(update,"?") == 0 || strcmp(update, "help") == 0)
+ fprintf(stderr, Name ": ");
+ else
+ fprintf(stderr, Name ": '--update=%s' is invalid. ", update);
+ fprintf(stderr, "Valid --update options are:\n"
+ " 'sparc2.2', 'super-minor', 'uuid', 'name', 'resync',\n"
+ " 'summaries', 'homehost', 'byteorder'.\n");
exit(2);
case O(ASSEMBLE,NoDegraded): /* --no-degraded */