diff options
| author | 2020-06-05 20:50:34 +0200 | |
|---|---|---|
| committer | 2020-06-05 20:50:34 +0200 | |
| commit | 489a673aeeef4706af3986d41c24ab434e77d7d5 (patch) | |
| tree | 123022859215220cf7f10a483d02bffdf157a0ce /tools/idevicesetlocation.c | |
| parent | 3aa4e243faa8198550cb2851cb6f0b9cbb293812 (diff) | |
| download | libimobiledevice-489a673aeeef4706af3986d41c24ab434e77d7d5.tar.gz libimobiledevice-489a673aeeef4706af3986d41c24ab434e77d7d5.tar.bz2 | |
tools: Unify --network command line switch and add it where missing
Diffstat (limited to 'tools/idevicesetlocation.c')
| -rw-r--r-- | tools/idevicesetlocation.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/idevicesetlocation.c b/tools/idevicesetlocation.c index 47f15ca..6332e3c 100644 --- a/tools/idevicesetlocation.c +++ b/tools/idevicesetlocation.c | |||
| @@ -54,7 +54,7 @@ static void print_usage(int argc, char **argv, int is_error) | |||
| 54 | fprintf(is_error ? stderr : stdout, "\n" \ | 54 | fprintf(is_error ? stderr : stdout, "\n" \ |
| 55 | "OPTIONS:\n" \ | 55 | "OPTIONS:\n" \ |
| 56 | " -u, --udid UDID target specific device by UDID\n" \ | 56 | " -u, --udid UDID target specific device by UDID\n" \ |
| 57 | " -n, --network connect to network device even if available via USB\n" \ | 57 | " -n, --network connect to network device\n" \ |
| 58 | " -d, --debug enable communication debugging\n" \ | 58 | " -d, --debug enable communication debugging\n" \ |
| 59 | " -h, --help prints usage information\n" \ | 59 | " -h, --help prints usage information\n" \ |
| 60 | " -v, --version prints version information\n" \ | 60 | " -v, --version prints version information\n" \ |
| @@ -77,7 +77,7 @@ int main(int argc, char **argv) | |||
| 77 | }; | 77 | }; |
| 78 | uint32_t mode = 0; | 78 | uint32_t mode = 0; |
| 79 | char *udid = NULL; | 79 | char *udid = NULL; |
| 80 | enum idevice_options lookup_opts = IDEVICE_LOOKUP_USBMUX | IDEVICE_LOOKUP_NETWORK; | 80 | int use_network = 0; |
| 81 | 81 | ||
| 82 | while ((c = getopt_long(argc, argv, "dhu:nv", longopts, NULL)) != -1) { | 82 | while ((c = getopt_long(argc, argv, "dhu:nv", longopts, NULL)) != -1) { |
| 83 | switch (c) { | 83 | switch (c) { |
| @@ -94,7 +94,7 @@ int main(int argc, char **argv) | |||
| 94 | udid = strdup(optarg); | 94 | udid = strdup(optarg); |
| 95 | break; | 95 | break; |
| 96 | case 'n': | 96 | case 'n': |
| 97 | lookup_opts |= IDEVICE_LOOKUP_PREFER_NETWORK; | 97 | use_network = 1; |
| 98 | break; | 98 | break; |
| 99 | case 'h': | 99 | case 'h': |
| 100 | print_usage(argc, argv, 0); | 100 | print_usage(argc, argv, 0); |
| @@ -129,7 +129,7 @@ int main(int argc, char **argv) | |||
| 129 | 129 | ||
| 130 | idevice_t device = NULL; | 130 | idevice_t device = NULL; |
| 131 | 131 | ||
| 132 | if (idevice_new_with_options(&device, udid, lookup_opts) != IDEVICE_E_SUCCESS) { | 132 | if (idevice_new_with_options(&device, udid, (use_network) ? IDEVICE_LOOKUP_NETWORK : IDEVICE_LOOKUP_USBMUX) != IDEVICE_E_SUCCESS) { |
| 133 | if (udid) { | 133 | if (udid) { |
| 134 | printf("ERROR: Device %s not found!\n", udid); | 134 | printf("ERROR: Device %s not found!\n", udid); |
| 135 | } else { | 135 | } else { |
