summaryrefslogtreecommitdiffstats
path: root/tools/idevicedebug.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/idevicedebug.c')
-rw-r--r--tools/idevicedebug.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/tools/idevicedebug.c b/tools/idevicedebug.c
index 01551a2..fbb6c3e 100644
--- a/tools/idevicedebug.c
+++ b/tools/idevicedebug.c
@@ -177,27 +177,26 @@ static debugserver_error_t debugserver_client_handle_response(debugserver_client
177 177
178static void print_usage(int argc, char **argv, int is_error) 178static void print_usage(int argc, char **argv, int is_error)
179{ 179{
180 char *name = NULL; 180 char *name = strrchr(argv[0], '/');
181 name = strrchr(argv[0], '/');
182 fprintf(is_error ? stderr : stdout, "Usage: %s [OPTIONS] COMMAND\n", (name ? name + 1: argv[0])); 181 fprintf(is_error ? stderr : stdout, "Usage: %s [OPTIONS] COMMAND\n", (name ? name + 1: argv[0]));
183 fprintf(is_error ? stderr : stdout, 182 fprintf(is_error ? stderr : stdout,
184 "\n" \ 183 "\n"
185 "Interact with the debugserver service of a device.\n" \ 184 "Interact with the debugserver service of a device.\n"
186 "\n" \ 185 "\n"
187 "Where COMMAND is one of:\n" \ 186 "Where COMMAND is one of:\n"
188 " run BUNDLEID [ARGS...]\trun app with BUNDLEID and optional ARGS on device.\n" \ 187 " run BUNDLEID [ARGS...] run app with BUNDLEID and optional ARGS on device.\n"
189 " kill BUNDLEID\tkill app with BUNDLEID\n" \ 188 " kill BUNDLEID kill app with BUNDLEID\n"
190 "\n" \ 189 "\n"
191 "The following OPTIONS are accepted:\n" \ 190 "The following OPTIONS are accepted:\n"
192 " -u, --udid UDID\ttarget specific device by UDID\n" \ 191 " -u, --udid UDID target specific device by UDID\n"
193 " -n, --network\t\tconnect to network device\n" \ 192 " -n, --network connect to network device\n"
194 " --detach\t\tdetach from app after launch, keeping it running\n" \ 193 " --detach detach from app after launch, keeping it running\n"
195 " -e, --env NAME=VALUE\tset environment variable NAME to VALUE\n" \ 194 " -e, --env NAME=VALUE set environment variable NAME to VALUE\n"
196 " -d, --debug\t\tenable communication debugging\n" \ 195 " -d, --debug enable communication debugging\n"
197 " -h, --help\t\tprints usage information\n" \ 196 " -h, --help prints usage information\n"
198 " -v, --version\t\tprints version information\n" \ 197 " -v, --version prints version information\n"
199 "\n" \ 198 "\n"
200 "Homepage: <" PACKAGE_URL ">\n" \ 199 "Homepage: <" PACKAGE_URL ">\n"
201 "Bug Reports: <" PACKAGE_BUGREPORT ">\n" 200 "Bug Reports: <" PACKAGE_BUGREPORT ">\n"
202 ); 201 );
203} 202}
@@ -294,13 +293,13 @@ int main(int argc, char *argv[])
294 break; 293 break;
295 } 294 }
296 } 295 }
297
298 argc -= optind; 296 argc -= optind;
299 argv += optind; 297 argv += optind;
300 298
301 if (argc < 1) { 299 if (argc < 1) {
302 fprintf(stderr, "ERROR: Missing command.\n"); 300 fprintf(stderr, "ERROR: Missing command.\n");
303 print_usage(argc+optind, argv-optind, 1); 301 print_usage(argc+optind, argv-optind, 1);
302 return 2;
304 } 303 }
305 304
306 if (!strcmp(argv[0], "run")) { 305 if (!strcmp(argv[0], "run")) {