summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-02-11 16:42:43 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-02-11 16:47:46 -0800
commit5c022b0f411e6cd7c35f2905b77fe2a1df2cd760 (patch)
tree592f139eda99663286fa666b8635e1ef81038e93
parentc00677ee7745532fc20027f6e67481f1ed1b5e9f (diff)
Print which arguments were unknown before giving usage message
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xmore.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/xmore.c b/xmore.c
index ed6be29..4ff53f4 100644
--- a/xmore.c
+++ b/xmore.c
@@ -146,6 +146,11 @@ int main( int argc, char *argv[] )
if (argc != 2)
{
+ fputs("Unknown argument(s):", stderr);
+ for (int i = 1; i < argc; i++) {
+ fprintf(stderr, " %s", argv[i]);
+ }
+ fputs("\n\n", stderr);
printf("usage: %s [ x options ] filename\n", argv[0]);
exit(EXIT_FAILURE);
}