NeilBrown: Tidy up some argument parsing, particularly for -b
Martin F. Krafft
madduck at alioth.debian.org
Fri Jan 29 10:53:21 UTC 2010
Module: mdadm
Branch: upstream
Commit: a1331cc4068d4c0723dd46f3a170ed100adba000
URL: http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=a1331cc4068d4c0723dd46f3a170ed100adba000
Author: NeilBrown <neilb at suse.de>
Date: Fri Jan 29 14:54:55 2010 +1100
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 at suse.de>
---
mdadm.8 | 24 ++++++++++++------------
mdadm.c | 13 ++++++-------
mdadm.conf.5 | 2 +-
3 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/mdadm.8 b/mdadm.8
index 29e098b..882c3a2 100644
--- a/mdadm.8
+++ b/mdadm.8
@@ -250,18 +250,6 @@ Avoid printing purely informative messages. With this,
will be silent unless there is something really important to report.
.TP
-.BR \-b ", " \-\-brief
-Be less verbose. This is used with
-.B \-\-detail
-and
-.BR \-\-examine .
-Using
-.B \-\-brief
-with
-.B \-\-verbose
-gives an intermediate level of verbosity.
-
-.TP
.BR \-f ", " \-\-force
Be more forceful about certain operations. See the various modes for
the exact meaning of this option in different contexts.
@@ -1794,6 +1782,18 @@ For
.B \-\-scan
causes all devices listed in the config file to be examined.
+.TP
+.BR \-b ", " \-\-brief
+Be less verbose. This is used with
+.B \-\-detail
+and
+.BR \-\-examine .
+Using
+.B \-\-brief
+with
+.B \-\-verbose
+gives an intermediate level of verbosity.
+
.SH MONITOR MODE
.HP 12
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):
diff --git a/mdadm.conf.5 b/mdadm.conf.5
index 002e2b3..1c2ae58 100644
--- a/mdadm.conf.5
+++ b/mdadm.conf.5
@@ -380,7 +380,7 @@ preceded by plus or minus is allowed and is usually last.
When
.I mdadm
-is auto-assembling an array, with via
+is auto-assembling an array, either via
.I --assemble
or
.I --incremental
More information about the pkg-mdadm-commits
mailing list