diff options
| author | 2014-03-27 09:49:07 +0100 | |
|---|---|---|
| committer | 2014-03-27 09:49:07 +0100 | |
| commit | 9920211fb0c8d52dfa478af1104fbd6e174ed781 (patch) | |
| tree | 6268504f5f3a52b8c3ee6c8e0a2809dfda6d4874 /tools | |
| parent | 35ce2b89b0cd26f3eb128ed038d3713019111706 (diff) | |
| download | libimobiledevice-9920211fb0c8d52dfa478af1104fbd6e174ed781.tar.gz libimobiledevice-9920211fb0c8d52dfa478af1104fbd6e174ed781.tar.bz2 | |
idevicename: Update usage output to match other tools and add debug option
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/idevicename.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/idevicename.c b/tools/idevicename.c index e930f57..c5f293d 100644 --- a/tools/idevicename.c +++ b/tools/idevicename.c | |||
| @@ -33,8 +33,9 @@ static void print_usage() | |||
| 33 | printf("Usage: idevicename [OPTIONS] [NAME]\n"); | 33 | printf("Usage: idevicename [OPTIONS] [NAME]\n"); |
| 34 | printf("Display the device name or set it to NAME if specified.\n"); | 34 | printf("Display the device name or set it to NAME if specified.\n"); |
| 35 | printf("\n"); | 35 | printf("\n"); |
| 36 | printf(" --udid|-u UDID use UDID to target a specific device\n"); | 36 | printf(" -d, --debug\t\tenable communication debugging\n"); |
| 37 | printf(" --help|-h print usage information\n"); | 37 | printf(" -u, --udid UDID\tuse UDID to target a specific device\n"); |
| 38 | printf(" -h, --help\t\tprint usage information\n"); | ||
| 38 | printf("\n"); | 39 | printf("\n"); |
| 39 | } | 40 | } |
| 40 | 41 | ||
| @@ -51,7 +52,7 @@ int main(int argc, char** argv) | |||
| 51 | { NULL, 0, NULL, 0} | 52 | { NULL, 0, NULL, 0} |
| 52 | }; | 53 | }; |
| 53 | 54 | ||
| 54 | while ((c = getopt_long(argc, argv, "u:h", longopts, &optidx)) != -1) { | 55 | while ((c = getopt_long(argc, argv, "du:h", longopts, &optidx)) != -1) { |
| 55 | switch (c) { | 56 | switch (c) { |
| 56 | case 'u': | 57 | case 'u': |
| 57 | udid = strdup(optarg); | 58 | udid = strdup(optarg); |
| @@ -59,6 +60,9 @@ int main(int argc, char** argv) | |||
| 59 | case 'h': | 60 | case 'h': |
| 60 | print_usage(); | 61 | print_usage(); |
| 61 | return 0; | 62 | return 0; |
| 63 | case 'd': | ||
| 64 | idevice_set_debug_level(1); | ||
| 65 | break; | ||
| 62 | default: | 66 | default: |
| 63 | print_usage(); | 67 | print_usage(); |
| 64 | return -1; | 68 | return -1; |
