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

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

Gbp-Pq: Name 0005-canfdtest.c-Reformat-help-usage-output-to-be-compati.patch
pull/69/head
Alexander Gerasiov 2018-02-11 19:03:05 +03:00 committed by Alexander Gerasiov
parent 6db632531d
commit c56259ab33
1 changed files with 11 additions and 6 deletions

View File

@ -52,9 +52,11 @@ static int exit_sig;
static void print_usage(char *prg)
{
fprintf(stderr,
"%s - Full-duplex test program (DUT and host part).\n"
"Usage: %s [options] <can-interface>\n"
"\n"
"Options: -v (low verbosity)\n"
"Options:\n"
" -v (low verbosity)\n"
" -vv (high verbosity)\n"
" -g (generate messages)\n"
" -l COUNT (test loop count)\n"
@ -64,10 +66,12 @@ static void print_usage(char *prg)
"<can-interface> are sent back incrementing the CAN id and\n"
"all data bytes. The program can be aborted with ^C.\n"
"\n"
"Example:\n"
"\ton DUT : %s -v can0\n"
"\ton Host: %s -g -v can2\n",
prg, prg, prg);
"Examples:\n"
"\ton DUT:\n"
"%s -v can0\n"
"\ton Host:\n"
"%s -g -v can2\n",
prg, prg, prg, prg);
exit(1);
}
@ -320,7 +324,7 @@ int main(int argc, char *argv[])
signal(SIGHUP, signal_handler);
signal(SIGINT, signal_handler);
while ((opt = getopt(argc, argv, "gl:v")) != -1) {
while ((opt = getopt(argc, argv, "gl:v?")) != -1) {
switch (opt) {
case 'v':
verbose++;
@ -334,6 +338,7 @@ int main(int argc, char *argv[])
echo_gen = 1;
break;
case '?':
default:
print_usage(basename(argv[0]));
break;