diff options
| author | 2020-06-05 20:50:34 +0200 | |
|---|---|---|
| committer | 2020-06-05 20:50:34 +0200 | |
| commit | 489a673aeeef4706af3986d41c24ab434e77d7d5 (patch) | |
| tree | 123022859215220cf7f10a483d02bffdf157a0ce /tools/idevicenotificationproxy.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/idevicenotificationproxy.c')
| -rw-r--r-- | tools/idevicenotificationproxy.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/idevicenotificationproxy.c b/tools/idevicenotificationproxy.c index 15b63a3..cfc9260 100644 --- a/tools/idevicenotificationproxy.c +++ b/tools/idevicenotificationproxy.c | |||
| @@ -74,6 +74,7 @@ static void print_usage(int argc, char **argv) | |||
| 74 | printf("\n"); | 74 | printf("\n"); |
| 75 | printf("The following OPTIONS are accepted:\n"); | 75 | printf("The following OPTIONS are accepted:\n"); |
| 76 | printf(" -u, --udid UDID\ttarget specific device by UDID\n"); | 76 | printf(" -u, --udid UDID\ttarget specific device by UDID\n"); |
| 77 | printf(" -n, --network\t\tconnect to network device\n"); | ||
| 77 | printf(" -d, --debug\t\tenable communication debugging\n"); | 78 | printf(" -d, --debug\t\tenable communication debugging\n"); |
| 78 | printf(" -h, --help\t\tprints usage information\n"); | 79 | printf(" -h, --help\t\tprints usage information\n"); |
| 79 | printf(" -v, --version\t\tprints version information\n"); | 80 | printf(" -v, --version\t\tprints version information\n"); |
| @@ -98,6 +99,7 @@ int main(int argc, char *argv[]) | |||
| 98 | int result = -1; | 99 | int result = -1; |
| 99 | int i; | 100 | int i; |
| 100 | const char* udid = NULL; | 101 | const char* udid = NULL; |
| 102 | int use_network = 0; | ||
| 101 | int cmd = CMD_NONE; | 103 | int cmd = CMD_NONE; |
| 102 | char* cmd_arg = NULL; | 104 | char* cmd_arg = NULL; |
| 103 | 105 | ||
| @@ -133,6 +135,10 @@ int main(int argc, char *argv[]) | |||
| 133 | result = 0; | 135 | result = 0; |
| 134 | goto cleanup; | 136 | goto cleanup; |
| 135 | } | 137 | } |
| 138 | else if (!strcmp(argv[i], "-n") || !strcmp(argv[i], "--network")) { | ||
| 139 | use_network = 1; | ||
| 140 | continue; | ||
| 141 | } | ||
| 136 | else if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) { | 142 | else if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) { |
| 137 | printf("%s %s\n", TOOL_NAME, PACKAGE_VERSION); | 143 | printf("%s %s\n", TOOL_NAME, PACKAGE_VERSION); |
| 138 | result = 0; | 144 | result = 0; |
| @@ -185,11 +191,11 @@ int main(int argc, char *argv[]) | |||
| 185 | goto cleanup; | 191 | goto cleanup; |
| 186 | } | 192 | } |
| 187 | 193 | ||
| 188 | if (IDEVICE_E_SUCCESS != idevice_new(&device, udid)) { | 194 | if (IDEVICE_E_SUCCESS != idevice_new_with_options(&device, udid, (use_network) ? IDEVICE_LOOKUP_NETWORK : IDEVICE_LOOKUP_USBMUX)) { |
| 189 | if (udid) { | 195 | if (udid) { |
| 190 | printf("No device found with udid %s, is it plugged in?\n", udid); | 196 | printf("No device found with udid %s.\n", udid); |
| 191 | } else { | 197 | } else { |
| 192 | printf("No device found, is it plugged in?\n"); | 198 | printf("No device found.\n"); |
| 193 | } | 199 | } |
| 194 | goto cleanup; | 200 | goto cleanup; |
| 195 | } | 201 | } |
