From 770eeeaf2316b14d56a19732de17ed83c51db3e9 Mon Sep 17 00:00:00 2001 From: Oliver Hartkopp Date: Thu, 13 Mar 2008 21:52:20 +0000 Subject: [PATCH] Allow commandline option '-?' to print the help text. --- candump.c | 3 +-- canlogserver.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/candump.c b/candump.c index 5c2a7f2..1ed2b8d 100644 --- a/candump.c +++ b/candump.c @@ -204,7 +204,7 @@ int main(int argc, char **argv) last_tv.tv_sec = 0; last_tv.tv_usec = 0; - while ((opt = getopt(argc, argv, "m:v:i:e:t:cas:b:B:lL")) != -1) { + while ((opt = getopt(argc, argv, "m:v:i:e:t:cas:b:B:lL?")) != -1) { switch (opt) { case 'm': i = sscanf(optarg, "%x,%x,%x,%x,%x,%x", @@ -304,7 +304,6 @@ int main(int argc, char **argv) break; default: - fprintf(stderr, "Unknown option %c\n", opt); print_usage(basename(argv[0])); exit(1); break; diff --git a/canlogserver.c b/canlogserver.c index 5a17da9..9db8c57 100644 --- a/canlogserver.c +++ b/canlogserver.c @@ -208,7 +208,7 @@ int main(int argc, char **argv) last_tv.tv_sec = 0; last_tv.tv_usec = 0; - while ((opt = getopt(argc, argv, "m:v:i:e:p:")) != -1) { + while ((opt = getopt(argc, argv, "m:v:i:e:p:?")) != -1) { switch (opt) { case 'm': @@ -246,7 +246,6 @@ int main(int argc, char **argv) port = atoi(optarg); break; default: - fprintf(stderr, "Unknown option %c\n", opt); print_usage(basename(argv[0])); exit(1); break;