Commit e8ae210c authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #451 from monaka/pr-print-usage

[xpcat] Print usage in the parameter error.
parents 3f2743c3 71672494
...@@ -26,10 +26,12 @@ main(int argc, char *argv[]) ...@@ -26,10 +26,12 @@ main(int argc, char *argv[])
i++; i++;
if (i < argc) if (i < argc)
output = argv[i]; output = argv[i];
else else {
usage(argv[0]);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
} }
}
if (output) { if (output) {
outfile = fopen(output, "wb"); outfile = fopen(output, "wb");
...@@ -40,7 +42,10 @@ main(int argc, char *argv[]) ...@@ -40,7 +42,10 @@ main(int argc, char *argv[])
setbuf(outfile, NULL); setbuf(outfile, NULL);
for (i = 1; i < argc; i++) { for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-o") == 0) { i++; continue; } if (strcmp(argv[i], "-o") == 0) {
i++;
continue;
}
infile = fopen(argv[i], "rb"); infile = fopen(argv[i], "rb");
if (!infile) { if (!infile) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment