]> www.infradead.org Git - mtd-utils.git/commitdiff
MTD Utils. (Resubmit as attachment)
authorSteve Finney <saf76@earthlink.net>
Thu, 11 May 2006 22:33:12 +0000 (15:33 -0700)
committerDavid Woodhouse <dwmw2@infradead.org>
Sun, 14 May 2006 17:48:33 +0000 (18:48 +0100)
Add a basic usage message to flash_erase.c.

Signed-off-by: Steven Finney <sfinney@healthhero.com>
flash_erase.c

index 870cf4087336d8b4da32d104502c42d0253e9ed6..cf263fef18cbbacb474cd1666b856d9ee18546ce 100644 (file)
@@ -7,6 +7,7 @@
 #include <stdio.h>
 #include <fcntl.h>
 #include <time.h>
+#include <string.h>
 #include <sys/ioctl.h>
 #include <sys/mount.h>
 #include <mtd/mtd-user.h>
@@ -141,10 +142,10 @@ int main(int argc,char *argv[])
        int unlock;
        int res = 0;
 
-       if (1 >= argc)
-       {
-               fprintf(stderr,"You must specify a device\n");
-               return 16;
+       if (1 >= argc ||  !strcmp(argv[1], "-h") || !strcmp (argv[1], "--help") ) {
+               printf("Usage: flash_erase MTD-device [start] [cnt (# erase blocks)] [lock]\n"
+                      "       flash_erase -h | --help\n") ;
+               return 16 ;
        }
 
        if (argc > 2)