Browse Source

Use as command arguments the remaining parameters

This change allows execute st as 'st mutt' while it keeps the
compability with xterm and urxt.
master
noname@inventati.org 9 years ago
committed by Roberto E. Vargas Caballero
parent
commit
aff35af275
1 changed files with 10 additions and 7 deletions
  1. +10
    -7
      st.c

+ 10
- 7
st.c View File

@ -4008,7 +4008,8 @@ void
usage(void) { usage(void) {
die("%s " VERSION " (c) 2010-2015 st engineers\n" \ die("%s " VERSION " (c) 2010-2015 st engineers\n" \
"usage: st [-a] [-v] [-c class] [-f font] [-g geometry] [-o file]\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 int
@ -4027,12 +4028,8 @@ main(int argc, char *argv[]) {
opt_class = EARGF(usage()); opt_class = EARGF(usage());
break; break;
case 'e': 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; goto run;
case 'f': case 'f':
opt_font = EARGF(usage()); opt_font = EARGF(usage());
@ -4059,6 +4056,12 @@ main(int argc, char *argv[]) {
} ARGEND; } ARGEND;
run: run:
if(argc > 0) {
/* eat all remaining arguments */
opt_cmd = argv;
if(!opt_title)
opt_title = basename(xstrdup(argv[0]));
}
setlocale(LC_CTYPE, ""); setlocale(LC_CTYPE, "");
XSetLocaleModifiers(""); XSetLocaleModifiers("");
tnew(MAX(cols, 1), MAX(rows, 1)); tnew(MAX(cols, 1), MAX(rows, 1));


Loading…
Cancel
Save