From 80f9867431af4632749890b24c0256f0ab07640d Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 29 Aug 2012 18:17:06 -0700 Subject: [PATCH] fastboot: move help command before usb connect Move the help command handling before the call to open_device so that is doesn't block when no device is connected. Bug: 7078873 Change-Id: I4e9a4317bd72b4ceb4b9fc838eafd2e57b17a473 --- fastboot/fastboot.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fastboot/fastboot.c b/fastboot/fastboot.c index b6eab8cfc..c9def7b79 100644 --- a/fastboot/fastboot.c +++ b/fastboot/fastboot.c @@ -832,6 +832,11 @@ int main(int argc, char **argv) return 0; } + if (argc > 0 && !strcmp(*argv, "help")) { + usage(); + return 0; + } + usb = open_device(); while (argc > 0) { @@ -922,9 +927,6 @@ int main(int argc, char **argv) wants_reboot = 1; } else if(!strcmp(*argv, "oem")) { argc = do_oem_command(argc, argv); - } else if (!strcmp(*argv, "help")) { - usage(); - return 0; } else { usage(); return 1;