summaryrefslogtreecommitdiffstats
path: root/tools/idevicesyslog.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2022-04-30 13:31:20 +0200
committerGravatar Nikias Bassen2022-04-30 13:31:20 +0200
commit6cb13f9e6d3939930aecf91d8e23d1896a3b92e5 (patch)
tree371e4676ac914d9eef6bb4cfc0b5b6dc6f27da4f /tools/idevicesyslog.c
parent3b5cad28fabb236e05b8fff82fab5098127aa2bb (diff)
downloadlibimobiledevice-6cb13f9e6d3939930aecf91d8e23d1896a3b92e5.tar.gz
libimobiledevice-6cb13f9e6d3939930aecf91d8e23d1896a3b92e5.tar.bz2
tools: Use getopt for option parsing in all tools
Diffstat (limited to 'tools/idevicesyslog.c')
-rw-r--r--tools/idevicesyslog.c57
1 files changed, 28 insertions, 29 deletions
diff --git a/tools/idevicesyslog.c b/tools/idevicesyslog.c
index 44dd5ba..2a72d72 100644
--- a/tools/idevicesyslog.c
+++ b/tools/idevicesyslog.c
@@ -466,37 +466,36 @@ static void clean_exit(int sig)
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]\n", (name ? name + 1: argv[0]));
fprintf(is_error ? stderr : stdout,
- "\n" \
- "Relay syslog of a connected device.\n" \
- "\n" \
- "OPTIONS:\n" \
- " -u, --udid UDID target specific device by UDID\n" \
- " -n, --network connect to network device\n" \
- " -x, --exit exit when device disconnects\n" \
- " -h, --help prints usage information\n" \
- " -d, --debug enable communication debugging\n" \
- " -v, --version prints version information\n" \
- " --no-colors disable colored output\n" \
- "\n" \
- "FILTER OPTIONS:\n" \
- " -m, --match STRING only print messages that contain STRING\n" \
- " -t, --trigger STRING start logging when matching STRING\n" \
- " -T, --untrigger STRING stop logging when matching STRING\n" \
- " -p, --process PROCESS only print messages from matching process(es)\n" \
- " -e, --exclude PROCESS print all messages except matching process(es)\n" \
- " PROCESS is a process name or multiple process names\n" \
- " separated by \"|\".\n" \
- " -q, --quiet set a filter to exclude common noisy processes\n" \
- " --quiet-list prints the list of processes for --quiet and exits\n" \
- " -k, --kernel only print kernel messages\n" \
- " -K, --no-kernel suppress kernel messages\n" \
- "\n" \
- "For filter examples consult idevicesyslog(1) man page.\n" \
- "\n" \
+ "\n"
+ "Relay syslog of a connected device.\n"
+ "\n"
+ "OPTIONS:\n"
+ " -u, --udid UDID target specific device by UDID\n"
+ " -n, --network connect to network device\n"
+ " -x, --exit exit when device disconnects\n"
+ " -h, --help prints usage information\n"
+ " -d, --debug enable communication debugging\n"
+ " -v, --version prints version information\n"
+ " --no-colors disable colored output\n"
+ "\n"
+ "FILTER OPTIONS:\n"
+ " -m, --match STRING only print messages that contain STRING\n"
+ " -t, --trigger STRING start logging when matching STRING\n"
+ " -T, --untrigger STRING stop logging when matching STRING\n"
+ " -p, --process PROCESS only print messages from matching process(es)\n"
+ " -e, --exclude PROCESS print all messages except matching process(es)\n"
+ " PROCESS is a process name or multiple process names\n"
+ " separated by \"|\".\n"
+ " -q, --quiet set a filter to exclude common noisy processes\n"
+ " --quiet-list prints the list of processes for --quiet and exits\n"
+ " -k, --kernel only print kernel messages\n"
+ " -K, --no-kernel suppress kernel messages\n"
+ "\n"
+ "For filter examples consult idevicesyslog(1) man page.\n"
+ "\n"
"Homepage: <" PACKAGE_URL ">\n"
"Bug Reports: <" PACKAGE_BUGREPORT ">\n"
);