mirror of
https://github.com/linux-can/can-utils.git
synced 2026-09-22 08:06:34 +02:00
Consistencely allow '-?' to get a help text.
This commit is contained in:
+7
-2
@@ -103,7 +103,7 @@ int main(int argc, char **argv)
|
||||
last_tv.tv_sec = 0;
|
||||
last_tv.tv_usec = 0;
|
||||
|
||||
while ((opt = getopt(argc, argv, "s:d:ax:ct:")) != -1) {
|
||||
while ((opt = getopt(argc, argv, "s:d:ax:ct:?")) != -1) {
|
||||
switch (opt) {
|
||||
case 's':
|
||||
src = strtoul(optarg, (char **)NULL, 16);
|
||||
@@ -144,10 +144,15 @@ int main(int argc, char **argv)
|
||||
}
|
||||
break;
|
||||
|
||||
case '?':
|
||||
print_usage(basename(argv[0]));
|
||||
exit(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "Unknown option %c\n", opt);
|
||||
print_usage(basename(argv[0]));
|
||||
exit(0);
|
||||
exit(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user