summaryrefslogtreecommitdiffstats
path: root/tools/idevicedebugserverproxy.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2020-06-05 18:42:20 +0200
committerGravatar Nikias Bassen2020-06-05 18:42:20 +0200
commit3aa4e243faa8198550cb2851cb6f0b9cbb293812 (patch)
tree4ea94424d60f1f2e7852f148a41eaeb7e92657a5 /tools/idevicedebugserverproxy.c
parenta077067bf9458612d54157e3c875d065e3678a54 (diff)
downloadlibimobiledevice-3aa4e243faa8198550cb2851cb6f0b9cbb293812.tar.gz
libimobiledevice-3aa4e243faa8198550cb2851cb6f0b9cbb293812.tar.bz2
tools: Add --version command line switch
Diffstat (limited to 'tools/idevicedebugserverproxy.c')
-rw-r--r--tools/idevicedebugserverproxy.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/idevicedebugserverproxy.c b/tools/idevicedebugserverproxy.c
index 338a3c0..c0a0eff 100644
--- a/tools/idevicedebugserverproxy.c
+++ b/tools/idevicedebugserverproxy.c
@@ -23,6 +23,8 @@
#include <config.h>
#endif
+#define TOOL_NAME "idevicedebugserverproxy"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -73,9 +75,10 @@ static void print_usage(int argc, char **argv)
printf("Proxy debugserver connection from device to a local socket at PORT.\n");
printf("\n");
printf("OPTIONS:\n");
- printf(" -d, --debug\t\tenable communication debugging\n");
printf(" -u, --udid UDID\ttarget specific device by UDID\n");
+ printf(" -d, --debug\t\tenable communication debugging\n");
printf(" -h, --help\t\tprints usage information\n");
+ printf(" -v, --version\t\tprints version information\n");
printf("\n");
printf("Homepage: <" PACKAGE_URL ">\n");
printf("Bug Reports: <" PACKAGE_BUGREPORT ">\n");
@@ -213,7 +216,7 @@ static void* connection_handler(void* data)
debug("%s: client_fd = %d\n", __func__, socket_info->client_fd);
- derr = debugserver_client_start_service(socket_info->device, &socket_info->debugserver_client, "idevicedebugserverproxy");
+ derr = debugserver_client_start_service(socket_info->device, &socket_info->debugserver_client, TOOL_NAME);
if (derr != DEBUGSERVER_E_SUCCESS) {
fprintf(stderr, "Could not start debugserver on device!\nPlease make sure to mount a developer disk image first.\n");
return NULL;
@@ -295,6 +298,10 @@ int main(int argc, char *argv[])
print_usage(argc, argv);
return EXIT_SUCCESS;
}
+ else if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) {
+ printf("%s %s\n", TOOL_NAME, PACKAGE_VERSION);
+ return EXIT_SUCCESS;
+ }
else if (atoi(argv[i]) > 0) {
local_port = atoi(argv[i]);
continue;