Consistencely allow '-?' to get a help text.

This commit is contained in:
Oliver Hartkopp
2009-01-13 09:32:45 +00:00
parent 278ba6377d
commit 4369ac1c55
10 changed files with 56 additions and 19 deletions
+6 -1
View File
@@ -79,7 +79,7 @@ int main(int argc, char **argv)
FILE *outfile = stdout;
static int maxdev, devno, i, crlf, d4, opt;
while ((opt = getopt(argc, argv, "I:O:4n")) != -1) {
while ((opt = getopt(argc, argv, "I:O:4n?")) != -1) {
switch (opt) {
case 'I':
infile = fopen(optarg, "r");
@@ -105,6 +105,11 @@ int main(int argc, char **argv)
d4 = 1;
break;
case '?':
print_usage(basename(argv[0]));
return 0;
break;
default:
fprintf(stderr, "Unknown option %c\n", opt);
print_usage(basename(argv[0]));