diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/irecovery.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/irecovery.c b/tools/irecovery.c index c32a7f9..48a69f6 100644 --- a/tools/irecovery.c +++ b/tools/irecovery.c @@ -43,6 +43,7 @@ #define debug(...) if(verbose) fprintf(stderr, __VA_ARGS__) enum { + kNoAction, kResetDevice, kStartShell, kSendCommand, @@ -377,7 +378,7 @@ static void print_usage(int argc, char **argv) { int main(int argc, char* argv[]) { int i = 0; int opt = 0; - int action = 0; + int action = kNoAction; unsigned long long ecid = 0; int mode = -1; char* argument = NULL; @@ -461,6 +462,12 @@ int main(int argc, char* argv[]) { } } + if (action == kNoAction) { + fprintf(stderr, "ERROR: Missing action option\n"); + print_usage(argc, argv); + return -1; + } + if (verbose) irecv_set_debug_level(verbose); |