]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Improve error message when wrong --update option is given.
authorNeil Brown <neilb@suse.de>
Sun, 22 Oct 2006 22:56:27 +0000 (08:56 +1000)
committerNeil Brown <neilb@suse.de>
Sun, 22 Oct 2006 22:56:27 +0000 (08:56 +1000)
ChangeLog
ReadMe.c
mdadm.c

index 1aaa1ee6d8ff9d8567c1b185b75309da666d430c..7cb07fe41b82501b694af96fc8db915f24ee338f 100644 (file)
--- 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
index 5704423245d9ceeb0476d607db781008fc801bf0..2a352ef31f9a949ed81f420e9a1dffc156b251de 100644 (file)
--- 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 00514a6e694c1d0bf877ac876d927b3f34a6d116..41e6c4c5073ca0f676f1d44013e2ee736bce9006 100644 (file)
--- 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 */