From: Michal Sojka Date: Tue, 8 Jul 2014 10:14:32 +0000 (+0200) Subject: Improve documentation X-Git-Tag: pc-sw-update~22 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/can-benchmark.git/commitdiff_plain/1c379cb3292ef06cf2c81a890f6af13003c90f3c Improve documentation --- diff --git a/utils/sterm.c b/utils/sterm.c index ee7f8d7..305a985 100644 --- a/utils/sterm.c +++ b/utils/sterm.c @@ -106,6 +106,17 @@ void exit_on_escapeseq(const char *buf, int len) } } +void usage(const char* argv0) +{ + fprintf(stderr, "Usage: %s [options] \n", argv0); + fprintf(stderr, "Options:\n"); + fprintf(stderr, " -d [+|-] create short positive/negative pulse on DTR\n"); + fprintf(stderr, " -e ignore '~.' escape sequence\n"); + fprintf(stderr, " -n do not switch the device to raw mode\n"); + fprintf(stderr, " -r [+|-] create short positive/negative pulse on RTS\n"); + fprintf(stderr, " -s \n"); + fprintf(stderr, " -v verbose\n"); +} int main(int argc, char *argv[]) { @@ -163,7 +174,7 @@ int main(int argc, char *argv[]) verbose = true; break; default: /* '?' */ - fprintf(stderr, "Usage: %s [-s baudrate] [-v] \n", argv[0]); + usage(argv[0]); exit(1); } } @@ -173,6 +184,7 @@ int main(int argc, char *argv[]) if (!dev) { fprintf(stderr, "No device specified\n"); + usage(argv[0]); exit(1); }