From 5b57d35cfa51cc145c567465ea00ae564a4b61a1 Mon Sep 17 00:00:00 2001 From: sabetts Date: Sat, 15 Jan 2005 18:40:47 +0000 Subject: (main): Report extra unparsed arguments. --- ChangeLog | 2 ++ src/main.c | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index b1abee7..1923656 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2005-01-15 Shawn Betts + * src/main.c (main): Report extra unparsed arguments. + * src/actions.c (init_user_commands): set the last argument of the following commands to arg_REST: addhook, chdir, remhook, source, tmpwm, and prompt. diff --git a/src/main.c b/src/main.c index ca40587..deef611 100644 --- a/src/main.c +++ b/src/main.c @@ -566,6 +566,16 @@ main (int argc, char *argv[]) } } + /* Report extra unparsed arguments. */ + if (optind < argc) + { + fprintf (stderr, "Error: junk arguments: "); + while (optind < argc) + fprintf (stderr, "%s ", argv[optind++]); + fputc ('\n', stderr); + exit (EXIT_FAILURE); + } + if (!(dpy = XOpenDisplay (display))) { fprintf (stderr, "Can't open display\n"); -- cgit v1.2.3