From 6cb13f9e6d3939930aecf91d8e23d1896a3b92e5 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Sat, 30 Apr 2022 13:31:20 +0200 Subject: tools: Use getopt for option parsing in all tools --- tools/idevice_id.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'tools/idevice_id.c') 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 @@ static void print_usage(int argc, char **argv, int is_error) { - char *name = NULL; - name = strrchr(argv[0], '/'); + char *name = strrchr(argv[0], '/'); fprintf(is_error ? stderr : stdout, "Usage: %s [OPTIONS] [UDID]\n", (name ? name + 1: argv[0])); fprintf(is_error ? stderr : stdout, + "\n" + "List attached devices or print device name of given device.\n" "\n" \ - "List attached devices or print device name of given device.\n" \ + " If UDID is given, the name of the connected device with that UDID" + " will be retrieved.\n" "\n" \ - " If UDID is given, the name of the connected device with that UDID" \ - " will be retrieved.\n" \ - "\n" \ - "OPTIONS:\n" \ - " -l, --list list UDIDs of all devices attached via USB\n" \ - " -n, --network list UDIDs of all devices available via network\n" \ - " -d, --debug enable communication debugging\n" \ - " -h, --help prints usage information\n" \ - " -v, --version prints version information\n" \ - "\n" \ - "Homepage: <" PACKAGE_URL ">\n" \ + "OPTIONS:\n" + " -l, --list list UDIDs of all devices attached via USB\n" + " -n, --network list UDIDs of all devices available via network\n" + " -d, --debug enable communication debugging\n" + " -h, --help prints usage information\n" + " -v, --version prints version information\n" + "\n" + "Homepage: <" PACKAGE_URL ">\n" "Bug Reports: <" PACKAGE_BUGREPORT ">\n" ); } -- cgit v1.1-32-gdbae