diff options
author | Nikias Bassen | 2022-04-30 13:31:20 +0200 |
---|---|---|
committer | Nikias Bassen | 2022-04-30 13:31:20 +0200 |
commit | 6cb13f9e6d3939930aecf91d8e23d1896a3b92e5 (patch) | |
tree | 371e4676ac914d9eef6bb4cfc0b5b6dc6f27da4f /tools/ideviceinfo.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/ideviceinfo.c')
-rw-r--r-- | tools/ideviceinfo.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/tools/ideviceinfo.c b/tools/ideviceinfo.c index f80b678..ead3fa6 100644 --- a/tools/ideviceinfo.c +++ b/tools/ideviceinfo.c @@ -93,23 +93,22 @@ static int is_domain_known(const char *domain) static void print_usage(int argc, char **argv, int is_error) { int i = 0; - char *name = NULL; - name = strrchr(argv[0], '/'); + char *name = strrchr(argv[0], '/'); fprintf(is_error ? stderr : stdout, "Usage: %s [OPTIONS]\n", (name ? name + 1: argv[0])); fprintf(is_error ? stderr : stdout, - "\n" \ - "Show information about a connected device.\n" \ - "\n" \ - "OPTIONS:\n" \ - " -u, --udid UDID target specific device by UDID\n" \ - " -n, --network connect to network device\n" \ - " -s, --simple use a simple connection to avoid auto-pairing with the device\n" \ - " -q, --domain NAME set domain of query to NAME. Default: None\n" \ - " -k, --key NAME only query key specified by NAME. Default: All keys.\n" \ - " -x, --xml output information as xml plist instead of key/value pairs\n" \ - " -h, --help prints usage information\n" \ - " -d, --debug enable communication debugging\n" \ - " -v, --version prints version information\n" \ + "\n" + "Show information about a connected device.\n" + "\n" + "OPTIONS:\n" + " -u, --udid UDID target specific device by UDID\n" + " -n, --network connect to network device\n" + " -s, --simple use simple connection to avoid auto-pairing with device\n" + " -q, --domain NAME set domain of query to NAME. Default: None\n" \ + " -k, --key NAME only query key specified by NAME. Default: All keys.\n" \ + " -x, --xml output information in XML property list format\n" \ + " -h, --help prints usage information\n" \ + " -d, --debug enable communication debugging\n" \ + " -v, --version prints version information\n" \ "\n" ); fprintf(is_error ? stderr : stdout, "Known domains are:\n\n"); |