From 140f9bbcde006dbada78c97f98e5cc8ccb93e788 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Thu, 5 Dec 2013 14:35:27 +0100 Subject: Print error if user attempts to supply multiple command arguments --- src/ideviceinstaller.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c index 5758b46..59a6b38 100644 --- a/src/ideviceinstaller.c +++ b/src/ideviceinstaller.c @@ -330,6 +330,25 @@ static void parse_opts(int argc, char **argv) break; } + /* verify if multiple modes have been supplied */ + switch (c) { + case 'l': + case 'i': + case 'g': + case 'L': + case 'a': + case 'r': + case 'R': + if (cmd != CMD_NONE) { + printf("ERROR: A mode has already been supplied. Multiple modes are not supported.\n"); + print_usage(argc, argv); + exit(2); + } + break; + default: + break; + } + switch (c) { case 'h': print_usage(argc, argv); -- cgit v1.1-32-gdbae