From: "Angelo S. Mavridis Bartolome" <barkl...@gmail.com> --- src/moto-boot-usb.c | 23 ++++++++++++++++++----- 1 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/src/moto-boot-usb.c b/src/moto-boot-usb.c index 962a236..b389274 100644 --- a/src/moto-boot-usb.c +++ b/src/moto-boot-usb.c @@ -28,6 +28,7 @@ #include <stdio.h> #include <stdlib.h> +#include <stdbool.h> #include <unistd.h> #include <string.h> #include <getopt.h> @@ -627,7 +628,9 @@ static void usage() " moto-boot-usb setflag usb|dumpkeys|passthrough\t" "set memory flag for gen-blob\n" " moto-boot-usb off\t\t\t\t" - "power off the phone\n\n"); + "power off the phone\n" + " moto-boot-usb help\t\t\t\t" + "show this help screen\n\n"); info("You can use hexadecimal and decimal " "for <addr> and <size> arguments,\n" @@ -866,14 +869,24 @@ int main(int argc, char *argv[]) int k_offset = 0; int mach_id = 867; /* 867 is the old EZX mach id */ int ret; + bool hparam = 0; printf("%s\n", "$Id$"); - - if (argc < 2) { + + if (argc >= 2 && (!strcmp(argv[1], "help"))) + hparam = 1; + else if (argc >= 2 && (!strcmp(argv[1], "--help"))) + hparam = 1; + + if (argc < 2 || hparam) { usage(); - error("Too few arguments."); - exit(1); + if (!hparam) { + error("Too few arguments."); + exit(1); + } + + exit(0); } ezx_device_open(); -- 1.7.5.4