diff options
Diffstat (limited to 'x.c')
| -rw-r--r-- | x.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -270,6 +270,7 @@ static char *opt_io = NULL; static char *opt_line = NULL; static char *opt_name = NULL; static char *opt_title = NULL; +static char *opt_dir = NULL; static uint buttons; /* bit field of pressed buttons */ static int cursorblinks = 0; @@ -2727,12 +2728,12 @@ reload(int sig) void usage(void) { - die("usage: %s [-aiv] [-c class] [-f font] [-g geometry]" - " [-n name] [-o file]\n" + die("usage: %s [-aiv] [-c class] [-d path] [-f font]" + " [-g geometry] [-n name] [-o file]\n" " [-T title] [-t title] [-w windowid]" " [[-e] command [args ...]]\n" - " %s [-aiv] [-c class] [-f font] [-g geometry]" - " [-n name] [-o file]\n" + " %s [-aiv] [-c class] [-d path] [-f font]" + " [-g geometry] [-n name] [-o file]\n" " [-T title] [-t title] [-w windowid] -l line" " [stty_args ...]\n", argv0, argv0); } @@ -2793,6 +2794,9 @@ main(int argc, char *argv[]) if (!(defaultfontsize > 0)) usage(); break; + case 'd': + opt_dir = EARGF(usage()); + break; default: usage(); } ARGEND; @@ -2804,6 +2808,9 @@ run: if (!opt_title) opt_title = (opt_line || !opt_cmd) ? "st" : opt_cmd[0]; + if (opt_dir && chdir(opt_dir) != 0) + die("can't change into directory %s\n", opt_dir); + setlocale(LC_CTYPE, ""); XSetLocaleModifiers(""); xrdb_load(); |
