st.c | 17 ++++++++++------- diff --git a/st.c b/st.c index 40840ce58f515b6fd115d4f01f1a4116ce2df1e8..b1d3791aba830e96f7fc9e45f72947a81796622a 100644 --- a/st.c +++ b/st.c @@ -4008,7 +4008,8 @@ void usage(void) { die("%s " VERSION " (c) 2010-2015 st engineers\n" \ "usage: st [-a] [-v] [-c class] [-f font] [-g geometry] [-o file]\n" - " [-i] [-t title] [-w windowid] [-e command ...]\n", argv0); + " [-i] [-t title] [-w windowid] [-e command ...] [command ...]\n", + argv0); } int @@ -4027,12 +4028,8 @@ case 'c': opt_class = EARGF(usage()); break; case 'e': - /* eat all remaining arguments */ - if(argc > 1) { - opt_cmd = &argv[1]; - if(argv[1] != NULL && opt_title == NULL) - opt_title = basename(xstrdup(argv[1])); - } + if(argc > 1) + --argc, ++argv; goto run; case 'f': opt_font = EARGF(usage()); @@ -4059,6 +4056,12 @@ usage(); } ARGEND; run: + if(argc > 0) { + /* eat all remaining arguments */ + opt_cmd = argv; + if(!opt_title) + opt_title = basename(xstrdup(argv[0])); + } setlocale(LC_CTYPE, ""); XSetLocaleModifiers(""); tnew(MAX(cols, 1), MAX(rows, 1));