summaryrefslogtreecommitdiffstats
path: root/tools/ideviceimagemounter.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/ideviceimagemounter.c')
-rw-r--r--tools/ideviceimagemounter.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/tools/ideviceimagemounter.c b/tools/ideviceimagemounter.c
index 37c2154..b854d5d 100644
--- a/tools/ideviceimagemounter.c
+++ b/tools/ideviceimagemounter.c
@@ -62,27 +62,27 @@ typedef enum {
62 DISK_IMAGE_UPLOAD_TYPE_UPLOAD_IMAGE 62 DISK_IMAGE_UPLOAD_TYPE_UPLOAD_IMAGE
63} disk_image_upload_type_t; 63} disk_image_upload_type_t;
64 64
65static void print_usage(int argc, char **argv) 65static void print_usage(int argc, char **argv, int is_error)
66{ 66{
67 char *name = NULL; 67 char *name = strrchr(argv[0], '/');
68 68 fprintf(is_error ? stderr : stdout, "Usage: %s [OPTIONS] IMAGE_FILE IMAGE_SIGNATURE_FILE\n", (name ? name + 1: argv[0]));
69 name = strrchr(argv[0], '/'); 69 fprintf(is_error ? stderr : stdout,
70 printf("Usage: %s [OPTIONS] IMAGE_FILE IMAGE_SIGNATURE_FILE\n", (name ? name + 1: argv[0])); 70 "\n"
71 printf("\n"); 71 "Mounts the specified disk image on the device.\n"
72 printf("Mounts the specified disk image on the device.\n"); 72 "\n"
73 printf("\n"); 73 "OPTIONS:\n"
74 printf("OPTIONS:\n"); 74 " -u, --udid UDID target specific device by UDID\n"
75 printf(" -u, --udid UDID\ttarget specific device by UDID\n"); 75 " -n, --network connect to network device\n"
76 printf(" -n, --network\t\tconnect to network device\n"); 76 " -l, --list List mount information\n"
77 printf(" -l, --list\t\tList mount information\n"); 77 " -t, --imagetype TYPE Image type to use, default is 'Developer'\n"
78 printf(" -t, --imagetype\tImage type to use, default is 'Developer'\n"); 78 " -x, --xml Use XML output\n"
79 printf(" -x, --xml\t\tUse XML output\n"); 79 " -d, --debug enable communication debugging\n"
80 printf(" -d, --debug\t\tenable communication debugging\n"); 80 " -h, --help prints usage information\n"
81 printf(" -h, --help\t\tprints usage information\n"); 81 " -v, --version prints version information\n"
82 printf(" -v, --version\t\tprints version information\n"); 82 "\n"
83 printf("\n"); 83 "Homepage: <" PACKAGE_URL ">\n"
84 printf("Homepage: <" PACKAGE_URL ">\n"); 84 "Bug Reports: <" PACKAGE_BUGREPORT ">\n"
85 printf("Bug Reports: <" PACKAGE_BUGREPORT ">\n"); 85 );
86} 86}
87 87
88static void parse_opts(int argc, char **argv) 88static void parse_opts(int argc, char **argv)
@@ -108,12 +108,12 @@ static void parse_opts(int argc, char **argv)
108 108
109 switch (c) { 109 switch (c) {
110 case 'h': 110 case 'h':
111 print_usage(argc, argv); 111 print_usage(argc, argv, 0);
112 exit(0); 112 exit(0);
113 case 'u': 113 case 'u':
114 if (!*optarg) { 114 if (!*optarg) {
115 fprintf(stderr, "ERROR: UDID must not be empty!\n"); 115 fprintf(stderr, "ERROR: UDID must not be empty!\n");
116 print_usage(argc, argv); 116 print_usage(argc, argv, 1);
117 exit(2); 117 exit(2);
118 } 118 }
119 udid = optarg; 119 udid = optarg;
@@ -137,7 +137,7 @@ static void parse_opts(int argc, char **argv)
137 printf("%s %s\n", TOOL_NAME, PACKAGE_VERSION); 137 printf("%s %s\n", TOOL_NAME, PACKAGE_VERSION);
138 exit(0); 138 exit(0);
139 default: 139 default:
140 print_usage(argc, argv); 140 print_usage(argc, argv, 1);
141 exit(2); 141 exit(2);
142 } 142 }
143 } 143 }