diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-09-06 00:52:48 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-09-26 23:30:45 +0200 |
| commit | bd7e4225d18207250cc312be601ae1615f62f0ad (patch) | |
| tree | 8378788f0f6d42ea0612011f5adeba6bccb50ae7 /src/prc1/prc1.c | |
| parent | 3c0819236e4f07c8f57aaf1ca46d0d68aa761558 (diff) | |
| download | prc-bd7e4225d18207250cc312be601ae1615f62f0ad.tar.gz | |
Add prc front-end
Diffstat (limited to 'src/prc1/prc1.c')
| -rw-r--r-- | src/prc1/prc1.c | 9 |
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; } |
