diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-02-11 16:42:43 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-02-11 16:47:46 -0800 |
commit | 5c022b0f411e6cd7c35f2905b77fe2a1df2cd760 (patch) | |
tree | 592f139eda99663286fa666b8635e1ef81038e93 | |
parent | c00677ee7745532fc20027f6e67481f1ed1b5e9f (diff) |
Print which arguments were unknown before giving usage message
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | xmore.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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); } |