From a6f8b01d0c7eaa2b19d1ad0611f3afcad47ac061 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Thu, 14 Feb 2019 18:13:21 -0800 Subject: util: improve iteflash help output Some lines in 'itflash --help' output got quite long. This patch modifies the code so that the output looks as follows: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Usage: ./build/host/util/iteflash [-d] [-v ] [-p ] \ [-c ] [-i <1|2>] [-s ] [-u] \ [-e] [-r ] [-W <0|1|false|true>] [-w ] \ [-R base[:size]] --d[ebug] : output debug traces --e[rase] : erase all the flash content -c, --i2c-interface : I2C interface to use --i[interface] <1> : FTDI interface: A=1, B=2, ... --p[roduct] <0x1234> : USB product ID [-R|--range base[:size]] - allow to read or write just a slice of the file, starting at : bytes, or til the end of the file if is not specified, expressed in hex --r[ead] : read the flash content and write it into --s[erial] : USB serial string --u[nprotect] : remove flash write protect --v[endor] <0x1234> : USB vendor ID -W, --send-waveform <0|1|false|true> : Send the special waveform? Default is true. Set to false if ITE direct firmware update mode has already been enabled. --w[rite] : read and write it to flash ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ BRANCH=none BUG=none TEST=ran 'make BOARD=host utils' and verified that iteflash --help output matches the above. Change-Id: If10f62eb1050f3a92bca612ea854a3d30c0856f7 Signed-off-by: Vadim Bendebury Reviewed-on: https://chromium-review.googlesource.com/1474894 Reviewed-by: Namyoon Woo Reviewed-by: Matthew Blecker Reviewed-by: Jett Rink --- util/iteflash.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/util/iteflash.c b/util/iteflash.c index 1cecf11184..d0bfa745ee 100644 --- a/util/iteflash.c +++ b/util/iteflash.c @@ -1610,9 +1610,10 @@ static const struct option longopts[] = { static void display_usage(char *program) { - fprintf(stderr, "Usage: %s [-d] [-v ] [-p ] " - "[-c ] [-i <1|2>] [-s ] [-u] [-e] [-r ]" - "[-W <0|1|false|true>] [-w ] [-R base[:size]]\n", + fprintf(stderr, "Usage: %s [-d] [-v ] [-p ] \\\n" + " [-c ] [-i <1|2>] [-s ] [-u] \\\n" + " [-e] [-r ] [-W <0|1|false|true>] [-w ] \\\n" + " [-R base[:size]]\n", program); fprintf(stderr, "--d[ebug] : output debug traces\n"); fprintf(stderr, "--e[rase] : erase all the flash content\n"); @@ -1621,18 +1622,18 @@ static void display_usage(char *program) fprintf(stderr, "--i[interface] <1> : FTDI interface: A=1, B=2, ...\n"); fprintf(stderr, "--p[roduct] <0x1234> : USB product ID\n"); fprintf(stderr, "[-R|--range base[:size]] - allow to read or write " - "just a slice of the file, starting at . bytes, or" - " til the end of the file if is not specified, expressed" - " in hex\n"); + "just a slice of the file,\n starting at : " + "bytes, or til the end of the file if \n is not " + "specified, expressed in hex\n"); fprintf(stderr, "--r[ead] : read the flash content and " "write it into \n"); fprintf(stderr, "--s[erial] : USB serial string\n"); fprintf(stderr, "--u[nprotect] : remove flash write protect\n"); fprintf(stderr, "--v[endor] <0x1234> : USB vendor ID\n"); fprintf(stderr, "-W, --send-waveform <0|1|false|true> : Send the " - "specal waveform? Default is true." - " Set to false if ITE direct firmware update mode has " - "already been enabled.\n"); + "special waveform?\n Default is true. Set to false if ITE" + " direct firmware update\n mode has already been enabled.\n" + ); fprintf(stderr, "--w[rite] : read and " "write it to flash\n"); exit(2); -- cgit v1.2.1