diff options
author | 2022-04-30 13:31:20 +0200 | |
---|---|---|
committer | 2022-04-30 13:31:20 +0200 | |
commit | 6cb13f9e6d3939930aecf91d8e23d1896a3b92e5 (patch) | |
tree | 371e4676ac914d9eef6bb4cfc0b5b6dc6f27da4f /tools/idevice_id.c | |
parent | 3b5cad28fabb236e05b8fff82fab5098127aa2bb (diff) | |
download | libimobiledevice-6cb13f9e6d3939930aecf91d8e23d1896a3b92e5.tar.gz libimobiledevice-6cb13f9e6d3939930aecf91d8e23d1896a3b92e5.tar.bz2 |
tools: Use getopt for option parsing in all tools
Diffstat (limited to 'tools/idevice_id.c')
-rw-r--r-- | tools/idevice_id.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/tools/idevice_id.c b/tools/idevice_id.c index 98fd22d..540a6f2 100644 --- a/tools/idevice_id.c +++ b/tools/idevice_id.c | |||
@@ -38,24 +38,23 @@ | |||
38 | 38 | ||
39 | static void print_usage(int argc, char **argv, int is_error) | 39 | static void print_usage(int argc, char **argv, int is_error) |
40 | { | 40 | { |
41 | char *name = NULL; | 41 | char *name = strrchr(argv[0], '/'); |
42 | name = strrchr(argv[0], '/'); | ||
43 | fprintf(is_error ? stderr : stdout, "Usage: %s [OPTIONS] [UDID]\n", (name ? name + 1: argv[0])); | 42 | fprintf(is_error ? stderr : stdout, "Usage: %s [OPTIONS] [UDID]\n", (name ? name + 1: argv[0])); |
44 | fprintf(is_error ? stderr : stdout, | 43 | fprintf(is_error ? stderr : stdout, |
44 | "\n" | ||
45 | "List attached devices or print device name of given device.\n" | ||
45 | "\n" \ | 46 | "\n" \ |
46 | "List attached devices or print device name of given device.\n" \ | 47 | " If UDID is given, the name of the connected device with that UDID" |
48 | " will be retrieved.\n" | ||
47 | "\n" \ | 49 | "\n" \ |
48 | " If UDID is given, the name of the connected device with that UDID" \ | 50 | "OPTIONS:\n" |
49 | " will be retrieved.\n" \ | 51 | " -l, --list list UDIDs of all devices attached via USB\n" |
50 | "\n" \ | 52 | " -n, --network list UDIDs of all devices available via network\n" |
51 | "OPTIONS:\n" \ | 53 | " -d, --debug enable communication debugging\n" |
52 | " -l, --list list UDIDs of all devices attached via USB\n" \ | 54 | " -h, --help prints usage information\n" |
53 | " -n, --network list UDIDs of all devices available via network\n" \ | 55 | " -v, --version prints version information\n" |
54 | " -d, --debug enable communication debugging\n" \ | 56 | "\n" |
55 | " -h, --help prints usage information\n" \ | 57 | "Homepage: <" PACKAGE_URL ">\n" |
56 | " -v, --version prints version information\n" \ | ||
57 | "\n" \ | ||
58 | "Homepage: <" PACKAGE_URL ">\n" \ | ||
59 | "Bug Reports: <" PACKAGE_BUGREPORT ">\n" | 58 | "Bug Reports: <" PACKAGE_BUGREPORT ">\n" |
60 | ); | 59 | ); |
61 | } | 60 | } |