Whamcloud - gitweb
Add explanatory message to badblocks that -n and -w are mutually exclusive
authorTheodore Ts'o <tytso@mit.edu>
Mon, 13 Nov 2006 04:09:03 +0000 (23:09 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 13 Nov 2006 04:09:03 +0000 (23:09 -0500)
Addresses Debian Bug: #371869

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
misc/ChangeLog
misc/badblocks.c

index fb50257..fdcf4ce 100644 (file)
@@ -1,3 +1,10 @@
+2006-11-12  Theodore Tso  <tytso@mit.edu>
+
+       * badblocks.c (exclusive_usage): Add an explicit usage message
+               explaining to the user that the -n and -w message may not
+               be specified at the same time.  (Addresses Debian Bug:
+               #371869)
+
 2006-11-08  Theodore Tso  <tytso@mit.edu>
 
        * mke2fs.c (test_disk): Change the last_block argument passed to
index 40962fb..9867668 100644 (file)
@@ -81,6 +81,13 @@ static void usage(void)
        exit (1);
 }
 
+static void exclusive_usage(void)
+{
+       fprintf(stderr, 
+               _("The -n and -w options are mutually exclusive.\n\n"));
+       usage();
+}
+
 static unsigned long currently_testing = 0;
 static unsigned long num_blocks = 0;
 static ext2_badblocks_list bb_list = NULL;
@@ -880,13 +887,13 @@ int main (int argc, char ** argv)
                        break;
                case 'w':
                        if (w_flag)
-                               usage();
+                               exclusive_usage();
                        test_func = test_rw;
                        w_flag = 1;
                        break;
                case 'n':
                        if (w_flag)
-                               usage();
+                               exclusive_usage();
                        test_func = test_nd;
                        w_flag = 2;
                        break;