summaryrefslogtreecommitdiffstats
path: root/tools/ideviceinfo.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2020-06-05 20:50:34 +0200
committerGravatar Nikias Bassen2020-06-05 20:50:34 +0200
commit489a673aeeef4706af3986d41c24ab434e77d7d5 (patch)
tree123022859215220cf7f10a483d02bffdf157a0ce /tools/ideviceinfo.c
parent3aa4e243faa8198550cb2851cb6f0b9cbb293812 (diff)
downloadlibimobiledevice-489a673aeeef4706af3986d41c24ab434e77d7d5.tar.gz
libimobiledevice-489a673aeeef4706af3986d41c24ab434e77d7d5.tar.bz2
tools: Unify --network command line switch and add it where missing
Diffstat (limited to 'tools/ideviceinfo.c')
-rw-r--r--tools/ideviceinfo.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/ideviceinfo.c b/tools/ideviceinfo.c
index 9b13ab8..a222e69 100644
--- a/tools/ideviceinfo.c
+++ b/tools/ideviceinfo.c
@@ -100,7 +100,7 @@ static void print_usage(int argc, char **argv, int is_error)
100 "\n" \ 100 "\n" \
101 "OPTIONS:\n" \ 101 "OPTIONS:\n" \
102 " -u, --udid UDID target specific device by UDID\n" \ 102 " -u, --udid UDID target specific device by UDID\n" \
103 " -n, --network connect to network device even if available via USB\n" \ 103 " -n, --network connect to network device\n" \
104 " -s, --simple use a simple connection to avoid auto-pairing with the device\n" \ 104 " -s, --simple use a simple connection to avoid auto-pairing with the device\n" \
105 " -q, --domain NAME set domain of query to NAME. Default: None\n" \ 105 " -q, --domain NAME set domain of query to NAME. Default: None\n" \
106 " -k, --key NAME only query key specified by NAME. Default: All keys.\n" \ 106 " -k, --key NAME only query key specified by NAME. Default: All keys.\n" \
@@ -130,12 +130,12 @@ int main(int argc, char *argv[])
130 int simple = 0; 130 int simple = 0;
131 int format = FORMAT_KEY_VALUE; 131 int format = FORMAT_KEY_VALUE;
132 char* udid = NULL; 132 char* udid = NULL;
133 int use_network = 0;
133 char *domain = NULL; 134 char *domain = NULL;
134 char *key = NULL; 135 char *key = NULL;
135 char *xml_doc = NULL; 136 char *xml_doc = NULL;
136 uint32_t xml_length; 137 uint32_t xml_length;
137 plist_t node = NULL; 138 plist_t node = NULL;
138 enum idevice_options lookup_opts = IDEVICE_LOOKUP_USBMUX | IDEVICE_LOOKUP_NETWORK;
139 139
140 int c = 0; 140 int c = 0;
141 const struct option longopts[] = { 141 const struct option longopts[] = {
@@ -170,7 +170,7 @@ int main(int argc, char *argv[])
170 udid = strdup(optarg); 170 udid = strdup(optarg);
171 break; 171 break;
172 case 'n': 172 case 'n':
173 lookup_opts |= IDEVICE_LOOKUP_PREFER_NETWORK; 173 use_network = 1;
174 break; 174 break;
175 case 'q': 175 case 'q':
176 if (!*optarg) { 176 if (!*optarg) {
@@ -211,7 +211,7 @@ int main(int argc, char *argv[])
211 argc -= optind; 211 argc -= optind;
212 argv += optind; 212 argv += optind;
213 213
214 ret = idevice_new_with_options(&device, udid, lookup_opts); 214 ret = idevice_new_with_options(&device, udid, (use_network) ? IDEVICE_LOOKUP_NETWORK : IDEVICE_LOOKUP_USBMUX);
215 if (ret != IDEVICE_E_SUCCESS) { 215 if (ret != IDEVICE_E_SUCCESS) {
216 if (udid) { 216 if (udid) {
217 printf("ERROR: Device %s not found!\n", udid); 217 printf("ERROR: Device %s not found!\n", udid);