]> rtime.felk.cvut.cz Git - socketcan-devel.git/commitdiff
Allow commandline option '-?' to print the help text.
authorhartkopp <hartkopp@030b6a49-0b11-0410-94ab-b0dab22257f2>
Thu, 13 Mar 2008 21:52:20 +0000 (21:52 +0000)
committerhartkopp <hartkopp@030b6a49-0b11-0410-94ab-b0dab22257f2>
Thu, 13 Mar 2008 21:52:20 +0000 (21:52 +0000)
git-svn-id: svn://svn.berlios.de//socketcan/trunk@689 030b6a49-0b11-0410-94ab-b0dab22257f2

can-utils/candump.c
can-utils/canlogserver.c

index 5c2a7f2b84056fb430b120cbd7ff651e22abf79a..1ed2b8df0253516a02e29816fcb68423ada4cefb 100644 (file)
@@ -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;
index 5a17da95365006c33eeb4747915522e3343cdf1c..9db8c57f02079ccdee5bd471230d845475eed8d5 100644 (file)
@@ -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;