summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2013-12-05 14:35:27 +0100
committerGravatar Martin Szulecki2013-12-05 14:35:27 +0100
commit140f9bbcde006dbada78c97f98e5cc8ccb93e788 (patch)
tree5e148a2e607bbfea1621a473615d567f5e434767
parente17355477336d2f0de28136fb59c25dc6f61e491 (diff)
downloadideviceinstaller-140f9bbcde006dbada78c97f98e5cc8ccb93e788.tar.gz
ideviceinstaller-140f9bbcde006dbada78c97f98e5cc8ccb93e788.tar.bz2
Print error if user attempts to supply multiple command arguments
-rw-r--r--src/ideviceinstaller.c19
1 files changed, 19 insertions, 0 deletions
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);