Allow commandline option '-?' to print the help text.

pull/7/head
Oliver Hartkopp 2008-03-13 21:52:20 +00:00
parent 8891e44d28
commit 770eeeaf23
2 changed files with 2 additions and 4 deletions

View File

@ -204,7 +204,7 @@ int main(int argc, char **argv)
last_tv.tv_sec = 0; last_tv.tv_sec = 0;
last_tv.tv_usec = 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) { switch (opt) {
case 'm': case 'm':
i = sscanf(optarg, "%x,%x,%x,%x,%x,%x", i = sscanf(optarg, "%x,%x,%x,%x,%x,%x",
@ -304,7 +304,6 @@ int main(int argc, char **argv)
break; break;
default: default:
fprintf(stderr, "Unknown option %c\n", opt);
print_usage(basename(argv[0])); print_usage(basename(argv[0]));
exit(1); exit(1);
break; break;

View File

@ -208,7 +208,7 @@ int main(int argc, char **argv)
last_tv.tv_sec = 0; last_tv.tv_sec = 0;
last_tv.tv_usec = 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) { switch (opt) {
case 'm': case 'm':
@ -246,7 +246,6 @@ int main(int argc, char **argv)
port = atoi(optarg); port = atoi(optarg);
break; break;
default: default:
fprintf(stderr, "Unknown option %c\n", opt);
print_usage(basename(argv[0])); print_usage(basename(argv[0]));
exit(1); exit(1);
break; break;