diff options
| author | 2013-12-05 14:35:27 +0100 | |
|---|---|---|
| committer | 2013-12-05 14:35:27 +0100 | |
| commit | 140f9bbcde006dbada78c97f98e5cc8ccb93e788 (patch) | |
| tree | 5e148a2e607bbfea1621a473615d567f5e434767 /src | |
| parent | e17355477336d2f0de28136fb59c25dc6f61e491 (diff) | |
| download | ideviceinstaller-140f9bbcde006dbada78c97f98e5cc8ccb93e788.tar.gz ideviceinstaller-140f9bbcde006dbada78c97f98e5cc8ccb93e788.tar.bz2 | |
Print error if user attempts to supply multiple command arguments
Diffstat (limited to 'src')
| -rw-r--r-- | src/ideviceinstaller.c | 19 |
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) | |||
| 330 | break; | 330 | break; |
| 331 | } | 331 | } |
| 332 | 332 | ||
| 333 | /* verify if multiple modes have been supplied */ | ||
| 334 | switch (c) { | ||
| 335 | case 'l': | ||
| 336 | case 'i': | ||
| 337 | case 'g': | ||
| 338 | case 'L': | ||
| 339 | case 'a': | ||
| 340 | case 'r': | ||
| 341 | case 'R': | ||
| 342 | if (cmd != CMD_NONE) { | ||
| 343 | printf("ERROR: A mode has already been supplied. Multiple modes are not supported.\n"); | ||
| 344 | print_usage(argc, argv); | ||
| 345 | exit(2); | ||
| 346 | } | ||
| 347 | break; | ||
| 348 | default: | ||
| 349 | break; | ||
| 350 | } | ||
| 351 | |||
| 333 | switch (c) { | 352 | switch (c) { |
| 334 | case 'h': | 353 | case 'h': |
| 335 | print_usage(argc, argv); | 354 | print_usage(argc, argv); |
