slcand.c: Reformat help/usage output to be compatible with help2man.

Signed-off-by: Alexander Gerasiov <gq@debian.org>

Gbp-Pq: Name 0024-slcand.c-Reformat-help-usage-output-to-be-compatible.patch
pull/69/head
Alexander Gerasiov 2018-02-11 19:03:05 +03:00 committed by Alexander Gerasiov
parent 09f6dc6d17
commit 9e491bc553
1 changed files with 15 additions and 14 deletions

View File

@ -72,8 +72,10 @@ 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] <tty> [canif-name]\n\n", prg);
fprintf(stderr, "Options: -o (send open command 'O\\r')\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");
@ -84,10 +86,9 @@ void print_usage(char *prg)
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);
}