[PATCH 3/3] MTD Utils. Add minimal usage message to flash_erase

Steve Finney saf76 at earthlink.net
Tue May 2 13:00:50 EDT 2006


Better than nothing...

Signed-off-by: Steven Finney <sfinney at healthhero.com>

-----------------
--- util.orig/flash_erase.c     2006-05-02 07:52:41.608872384 -0700
+++ util/flash_erase.c  2006-05-02 09:37:02.336097176 -0700
@@ -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>
@@ -146,6 +147,11 @@ int main(int argc,char *argv[])
                fprintf(stderr,"You must specify a device\n");
                return 16;
        }
+       if ( !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") ;
+               exit (0);
+       }

        if (argc > 2)
                start = strtol(argv[2], NULL, 0);







More information about the linux-mtd mailing list