summaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/nandwrite.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/miscutils/nandwrite.c b/miscutils/nandwrite.c
index 29ff351a3..247fc72f4 100644
--- a/miscutils/nandwrite.c
+++ b/miscutils/nandwrite.c
@@ -36,16 +36,18 @@
36//usage: "\n -s ADDR Start address" 36//usage: "\n -s ADDR Start address"
37 37
38//usage:#define nanddump_trivial_usage 38//usage:#define nanddump_trivial_usage
39//usage: "[-o] [--bb=padbad|skipbad] [-s ADDR] [-l LEN] [-f FILE] MTD_DEVICE" 39//usage: "[-o]" IF_LONG_OPTS(" [--bb=padbad|skipbad]") " [-s ADDR] [-l LEN] [-f FILE] MTD_DEVICE"
40//usage:#define nanddump_full_usage "\n\n" 40//usage:#define nanddump_full_usage "\n\n"
41//usage: "Dump MTD_DEVICE\n" 41//usage: "Dump MTD_DEVICE\n"
42//usage: "\n -o Dump oob data" 42//usage: "\n -o Dump oob data"
43//usage: "\n -s ADDR Start address" 43//usage: "\n -s ADDR Start address"
44//usage: "\n -l LEN Length" 44//usage: "\n -l LEN Length"
45//usage: "\n -f FILE Dump to file ('-' for stdout)" 45//usage: "\n -f FILE Dump to file ('-' for stdout)"
46//usage: IF_LONG_OPTS(
46//usage: "\n --bb=METHOD:" 47//usage: "\n --bb=METHOD:"
47//usage: "\n skipbad: skip bad blocks" 48//usage: "\n skipbad: skip bad blocks"
48//usage: "\n padbad: substitute bad blocks by 0xff (default)" 49//usage: "\n padbad: substitute bad blocks by 0xff (default)"
50//usage: )
49 51
50#include "libbb.h" 52#include "libbb.h"
51#include <mtd/mtd-user.h> 53#include <mtd/mtd-user.h>
@@ -116,12 +118,13 @@ int nandwrite_main(int argc UNUSED_PARAM, char **argv)
116 struct mtd_oob_buf oob; 118 struct mtd_oob_buf oob;
117 unsigned char *filebuf; 119 unsigned char *filebuf;
118 const char *opt_s = "0", *opt_f = "-", *opt_l, *opt_bb; 120 const char *opt_s = "0", *opt_f = "-", *opt_l, *opt_bb;
119 static const char nanddump_longopts[] ALIGN1 =
120 "bb\0" Required_argument "\xff"; /* no short equivalent */
121 121
122 if (IS_NANDDUMP) { 122 if (IS_NANDDUMP) {
123 opt_complementary = "=1"; 123 opt_complementary = "=1";
124 applet_long_options = nanddump_longopts; 124#if ENABLE_LONG_OPTS
125 applet_long_options =
126 "bb\0" Required_argument "\xff"; /* no short equivalent */
127#endif
125 opts = getopt32(argv, "os:f:l:", &opt_s, &opt_f, &opt_l, &opt_bb); 128 opts = getopt32(argv, "os:f:l:", &opt_s, &opt_f, &opt_l, &opt_bb);
126 } else { /* nandwrite */ 129 } else { /* nandwrite */
127 opt_complementary = "-1:?2"; 130 opt_complementary = "-1:?2";