From 9e491bc5530c1798c05b8baeb3fab13e703dac05 Mon Sep 17 00:00:00 2001 From: Alexander Gerasiov Date: Sun, 11 Feb 2018 19:03:05 +0300 Subject: [PATCH] slcand.c: Reformat help/usage output to be compatible with help2man. Signed-off-by: Alexander Gerasiov Gbp-Pq: Name 0024-slcand.c-Reformat-help-usage-output-to-be-compatible.patch --- slcand.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/slcand.c b/slcand.c index 220048a..72e7ed4 100644 --- a/slcand.c +++ b/slcand.c @@ -72,22 +72,23 @@ static syslog_t syslogger = syslog; void print_usage(char *prg) { + fprintf(stderr, "%s - userspace daemon for serial line CAN interface driver SLCAN.\n", prg); fprintf(stderr, "\nUsage: %s [options] [canif-name]\n\n", prg); - fprintf(stderr, "Options: -o (send open command 'O\\r')\n"); - fprintf(stderr, " -c (send close command 'C\\r')\n"); - fprintf(stderr, " -f (read status flags with 'F\\r' to reset error states)\n"); - fprintf(stderr, " -l (send listen only command 'L\\r', overrides -o)\n"); - fprintf(stderr, " -s (set CAN speed 0..8)\n"); - fprintf(stderr, " -S (set UART speed in baud)\n"); - fprintf(stderr, " -t (set UART flow control type 'hw' or 'sw')\n"); - fprintf(stderr, " -b (set bit time register value)\n"); - fprintf(stderr, " -F (stay in foreground; no daemonize)\n"); - fprintf(stderr, " -h (show this help page)\n"); + fprintf(stderr, "Options:\n"); + fprintf(stderr, " -o (send open command 'O\\r')\n"); + fprintf(stderr, " -c (send close command 'C\\r')\n"); + fprintf(stderr, " -f (read status flags with 'F\\r' to reset error states)\n"); + fprintf(stderr, " -l (send listen only command 'L\\r', overrides -o)\n"); + fprintf(stderr, " -s (set CAN speed 0..8)\n"); + fprintf(stderr, " -S (set UART speed in baud)\n"); + fprintf(stderr, " -t (set UART flow control type 'hw' or 'sw')\n"); + fprintf(stderr, " -b (set bit time register value)\n"); + fprintf(stderr, " -F (stay in foreground; no daemonize)\n"); + fprintf(stderr, " -h (show this help page)\n"); fprintf(stderr, "\nExamples:\n"); - fprintf(stderr, "slcand -o -c -f -s6 ttyUSB0\n"); - fprintf(stderr, "slcand -o -c -f -s6 ttyUSB0 can0\n"); - fprintf(stderr, "slcand -o -c -f -s6 /dev/ttyUSB0\n"); - fprintf(stderr, "\n"); + fprintf(stderr, "slcand -o -c -f -s6 ttyUSB0\n\n"); + fprintf(stderr, "slcand -o -c -f -s6 ttyUSB0 can0\n\n"); + fprintf(stderr, "slcand -o -c -f -s6 /dev/ttyUSB0\n\n"); exit(EXIT_FAILURE); }