aboutsummaryrefslogtreecommitdiff
path: root/src/prc1/prc1.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/prc1/prc1.c')
-rw-r--r--src/prc1/prc1.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/prc1/prc1.c b/src/prc1/prc1.c
index 69165ba..6378907 100644
--- a/src/prc1/prc1.c
+++ b/src/prc1/prc1.c
@@ -14,16 +14,19 @@ int main(int argc, char *argv[])
FILE *f = stdin;
int opened = 0, ret = EXIT_FAILURE;
- if (argc != 2)
+ for (int i = 1; i < argc; i++)
+ fprintf(stderr, "[%d]=%s\n", i, argv[i]);
+
+ if (argc < 2)
{
- fprintf(stderr, "%s: error: missing input file\n", *argv);
+ fprintf(stderr, "%s [options ...] file\n", *argv);
goto end;
}
else if (strcmp(argv[1], "-"))
{
if (!(f = fopen(argv[1], "rb")))
{
- fprintf(stderr, "failed to open %s: %s\n", argv[1],
+ fprintf(stderr, "%s: failed to open %s: %s\n", *argv, argv[1],
strerror(errno));
goto end;
}