summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Finney <saf76@earthlink.net>2006-05-11 15:33:12 -0700
committerDavid Woodhouse <dwmw2@infradead.org>2006-05-14 18:48:33 +0100
commit378d454543e5357754e8d6727dc12e8afd797ddc (patch)
tree34f5b0076da002313f634504595043c8387ec438
parent9660df49a3f0388613dab3cc4c4ee93e85a6110b (diff)
MTD Utils. (Resubmit as attachment)
Add a basic usage message to flash_erase.c. Signed-off-by: Steven Finney <sfinney@healthhero.com>
-rw-r--r--flash_erase.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/flash_erase.c b/flash_erase.c
index 870cf40..cf263fe 100644
--- a/flash_erase.c
+++ b/flash_erase.c
@@ -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)