diff options
| author | P.P.A <adolphs@moselle.moe> | 2023-07-08 12:57:04 +0200 |
|---|---|---|
| committer | P.P.A <adolphs@moselle.moe> | 2023-07-08 12:57:04 +0200 |
| commit | 6f0517618f413be22695ef2466995dc09c22391b (patch) | |
| tree | dd3b887a91d6b83bdb7c16f5336a9f8684ac6282 /x.c | |
| parent | ac5a5e7a1cc72b0bdfe2e3373be3893d7fafc608 (diff) | |
workingdir
Diffstat (limited to 'x.c')
| -rw-r--r-- | x.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -268,6 +268,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; @@ -2124,12 +2125,12 @@ config_init(void) 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); } @@ -2184,6 +2185,9 @@ main(int argc, char *argv[]) case 'v': die("%s " VERSION "\n", argv0); break; + case 'd': + opt_dir = EARGF(usage()); + break; default: usage(); } ARGEND; @@ -2208,6 +2212,7 @@ run: xinit(cols, rows); xsetenv(); selinit(); + chdir(opt_dir); run(); return 0; |
