diff options
| author | 2020-06-04 04:52:41 +0200 | |
|---|---|---|
| committer | 2020-06-04 04:52:41 +0200 | |
| commit | 76b58295b986582f8ca2e8d2f08e0f6b593d0f6d (patch) | |
| tree | 1e1084c64a8ff6c5ce106eeb6b654965c0e297b0 | |
| parent | cc9353ce6547a7cc3184e29c5583aff8ef7a5916 (diff) | |
| download | ideviceinstaller-76b58295b986582f8ca2e8d2f08e0f6b593d0f6d.tar.gz ideviceinstaller-76b58295b986582f8ca2e8d2f08e0f6b593d0f6d.tar.bz2 | |
Add new "--version" option to output version information
| -rw-r--r-- | src/ideviceinstaller.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c index cb977f4..e109931 100644 --- a/src/ideviceinstaller.c +++ b/src/ideviceinstaller.c | |||
| @@ -415,6 +415,7 @@ static void print_usage(int argc, char **argv) | |||
| 415 | " \t\tto before reporting success of operation\n" | 415 | " \t\tto before reporting success of operation\n" |
| 416 | " -h, --help\t\tprints usage information\n" | 416 | " -h, --help\t\tprints usage information\n" |
| 417 | " -d, --debug\t\tenable communication debugging\n" | 417 | " -d, --debug\t\tenable communication debugging\n" |
| 418 | " -v, --version\t\tprint version information\n" | ||
| 418 | "\n" | 419 | "\n" |
| 419 | ); | 420 | ); |
| 420 | printf("Homepage: <" PACKAGE_URL ">\n"); | 421 | printf("Homepage: <" PACKAGE_URL ">\n"); |
| @@ -437,12 +438,13 @@ static void parse_opts(int argc, char **argv) | |||
| 437 | { "options", required_argument, NULL, 'o' }, | 438 | { "options", required_argument, NULL, 'o' }, |
| 438 | { "notify-wait", no_argument, NULL, 'n' }, | 439 | { "notify-wait", no_argument, NULL, 'n' }, |
| 439 | { "debug", no_argument, NULL, 'd' }, | 440 | { "debug", no_argument, NULL, 'd' }, |
| 441 | { "version", no_argument, NULL, 'v' }, | ||
| 440 | { NULL, 0, NULL, 0 } | 442 | { NULL, 0, NULL, 0 } |
| 441 | }; | 443 | }; |
| 442 | int c; | 444 | int c; |
| 443 | 445 | ||
| 444 | while (1) { | 446 | while (1) { |
| 445 | c = getopt_long(argc, argv, "hU:li:u:g:La:r:R:o:nd", longopts, | 447 | c = getopt_long(argc, argv, "hU:li:u:g:La:r:R:o:ndv", longopts, |
| 446 | (int *) 0); | 448 | (int *) 0); |
| 447 | if (c == -1) { | 449 | if (c == -1) { |
| 448 | break; | 450 | break; |
| @@ -527,6 +529,9 @@ static void parse_opts(int argc, char **argv) | |||
| 527 | case 'd': | 529 | case 'd': |
| 528 | idevice_set_debug_level(1); | 530 | idevice_set_debug_level(1); |
| 529 | break; | 531 | break; |
| 532 | case 'v': | ||
| 533 | printf("%s %s\n", PACKAGE_NAME, PACKAGE_VERSION); | ||
| 534 | exit(0); | ||
| 530 | default: | 535 | default: |
| 531 | print_usage(argc, argv); | 536 | print_usage(argc, argv); |
| 532 | exit(2); | 537 | exit(2); |
