summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-02-11 15:39:53 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-02-11 15:39:53 -0800
commit972d4c5c6a4293b7da32194f219e5299e4e33e37 (patch)
tree0965da0e1cad0d19683b25472e19adadab817ca9
parentdcdcf365ed71dbceb591e01993c4ef390099b2ac (diff)
Print which arguments were unknown before giving usage message
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xmag.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/xmag.c b/xmag.c
index f74eb43..3dff66c 100644
--- a/xmag.c
+++ b/xmag.c
@@ -1123,6 +1123,11 @@ main(int argc, char *argv[])
XtGetApplicationResources(toplevel, (XtPointer) &options, resources,
XtNumber(resources), NULL, 0);
if (argc != 1) {
+ fputs("Unknown argument(s):", stderr);
+ for (int n = 1; n < argc; n++) {
+ fprintf(stderr, " %s", argv[n]);
+ }
+ fputs("\n\n", stderr);
fprintf (stderr,
"usage: xmag [-source geom] [-mag magfactor] [-toolkitoption]\n");
exit(1);