diff options
Diffstat (limited to 'tools/idevicenotificationproxy.c')
| -rw-r--r-- | tools/idevicenotificationproxy.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/idevicenotificationproxy.c b/tools/idevicenotificationproxy.c index 45744bc..15b63a3 100644 --- a/tools/idevicenotificationproxy.c +++ b/tools/idevicenotificationproxy.c | |||
| @@ -23,6 +23,8 @@ | |||
| 23 | #include <config.h> | 23 | #include <config.h> |
| 24 | #endif | 24 | #endif |
| 25 | 25 | ||
| 26 | #define TOOL_NAME "idevicenotificationproxy" | ||
| 27 | |||
| 26 | #include <stdio.h> | 28 | #include <stdio.h> |
| 27 | #include <string.h> | 29 | #include <string.h> |
| 28 | #include <errno.h> | 30 | #include <errno.h> |
| @@ -71,9 +73,10 @@ static void print_usage(int argc, char **argv) | |||
| 71 | printf(" observe ID [...]\tobserve notification IDs in the foreground until CTRL+C or signal is received\n"); | 73 | printf(" observe ID [...]\tobserve notification IDs in the foreground until CTRL+C or signal is received\n"); |
| 72 | printf("\n"); | 74 | printf("\n"); |
| 73 | printf("The following OPTIONS are accepted:\n"); | 75 | printf("The following OPTIONS are accepted:\n"); |
| 74 | printf(" -d, --debug\t\tenable communication debugging\n"); | ||
| 75 | printf(" -u, --udid UDID\ttarget specific device by UDID\n"); | 76 | printf(" -u, --udid UDID\ttarget specific device by UDID\n"); |
| 77 | printf(" -d, --debug\t\tenable communication debugging\n"); | ||
| 76 | printf(" -h, --help\t\tprints usage information\n"); | 78 | printf(" -h, --help\t\tprints usage information\n"); |
| 79 | printf(" -v, --version\t\tprints version information\n"); | ||
| 77 | printf("\n"); | 80 | printf("\n"); |
| 78 | printf("Homepage: <" PACKAGE_URL ">\n"); | 81 | printf("Homepage: <" PACKAGE_URL ">\n"); |
| 79 | printf("Bug Reports: <" PACKAGE_BUGREPORT ">\n"); | 82 | printf("Bug Reports: <" PACKAGE_BUGREPORT ">\n"); |
| @@ -130,6 +133,11 @@ int main(int argc, char *argv[]) | |||
| 130 | result = 0; | 133 | result = 0; |
| 131 | goto cleanup; | 134 | goto cleanup; |
| 132 | } | 135 | } |
| 136 | else if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) { | ||
| 137 | printf("%s %s\n", TOOL_NAME, PACKAGE_VERSION); | ||
| 138 | result = 0; | ||
| 139 | goto cleanup; | ||
| 140 | } | ||
| 133 | else if (!strcmp(argv[i], "post") || !strcmp(argv[i], "observe")) { | 141 | else if (!strcmp(argv[i], "post") || !strcmp(argv[i], "observe")) { |
| 134 | cmd = CMD_POST; | 142 | cmd = CMD_POST; |
| 135 | if (!strcmp(argv[i], "observe")) { | 143 | if (!strcmp(argv[i], "observe")) { |
| @@ -186,7 +194,7 @@ int main(int argc, char *argv[]) | |||
| 186 | goto cleanup; | 194 | goto cleanup; |
| 187 | } | 195 | } |
| 188 | 196 | ||
| 189 | if (LOCKDOWN_E_SUCCESS != (ret = lockdownd_client_new_with_handshake(device, &client, "idevicenotificationproxy"))) { | 197 | if (LOCKDOWN_E_SUCCESS != (ret = lockdownd_client_new_with_handshake(device, &client, TOOL_NAME))) { |
| 190 | fprintf(stderr, "ERROR: Could not connect to lockdownd, error code %d\n", ret); | 198 | fprintf(stderr, "ERROR: Could not connect to lockdownd, error code %d\n", ret); |
| 191 | goto cleanup; | 199 | goto cleanup; |
| 192 | } | 200 | } |
