mirror of
https://codeberg.org/frosty/st.git
synced 2024-09-19 03:37:00 -04:00
patch: workingdir
This commit is contained in:
parent
4d63ceec5f
commit
142a94876f
8
st.1
8
st.1
|
@ -6,6 +6,8 @@ st \- simple terminal
|
||||||
.RB [ \-aiv ]
|
.RB [ \-aiv ]
|
||||||
.RB [ \-c
|
.RB [ \-c
|
||||||
.IR class ]
|
.IR class ]
|
||||||
|
.RB [ \-d
|
||||||
|
.IR path ]
|
||||||
.RB [ \-f
|
.RB [ \-f
|
||||||
.IR font ]
|
.IR font ]
|
||||||
.RB [ \-g
|
.RB [ \-g
|
||||||
|
@ -32,6 +34,8 @@ st \- simple terminal
|
||||||
.RB [ \-aiv ]
|
.RB [ \-aiv ]
|
||||||
.RB [ \-c
|
.RB [ \-c
|
||||||
.IR class ]
|
.IR class ]
|
||||||
|
.RB [ \-d
|
||||||
|
.IR path ]
|
||||||
.RB [ \-f
|
.RB [ \-f
|
||||||
.IR font ]
|
.IR font ]
|
||||||
.RB [ \-g
|
.RB [ \-g
|
||||||
|
@ -62,6 +66,10 @@ disable alternate screens in terminal
|
||||||
.BI \-c " class"
|
.BI \-c " class"
|
||||||
defines the window class (default $TERM).
|
defines the window class (default $TERM).
|
||||||
.TP
|
.TP
|
||||||
|
.BI \-d " path"
|
||||||
|
changes the working directory to
|
||||||
|
.IR path .
|
||||||
|
.TP
|
||||||
.BI \-f " font"
|
.BI \-f " font"
|
||||||
defines the
|
defines the
|
||||||
.I font
|
.I font
|
||||||
|
|
13
x.c
13
x.c
|
@ -264,6 +264,7 @@ static char *opt_io = NULL;
|
||||||
static char *opt_line = NULL;
|
static char *opt_line = NULL;
|
||||||
static char *opt_name = NULL;
|
static char *opt_name = NULL;
|
||||||
static char *opt_title = NULL;
|
static char *opt_title = NULL;
|
||||||
|
static char *opt_dir = NULL;
|
||||||
|
|
||||||
static uint buttons; /* bit field of pressed buttons */
|
static uint buttons; /* bit field of pressed buttons */
|
||||||
|
|
||||||
|
@ -2205,12 +2206,12 @@ run(void)
|
||||||
void
|
void
|
||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
die("usage: %s [-aiv] [-c class] [-f font] [-g geometry]"
|
die("usage: %s [-aiv] [-c class] [-d path] [-f font]"
|
||||||
" [-n name] [-o file]\n"
|
" [-g geometry] [-n name] [-o file]\n"
|
||||||
" [-T title] [-t title] [-w windowid]"
|
" [-T title] [-t title] [-w windowid]"
|
||||||
" [[-e] command [args ...]]\n"
|
" [[-e] command [args ...]]\n"
|
||||||
" %s [-aiv] [-c class] [-f font] [-g geometry]"
|
" %s [-aiv] [-c class] [-d path] [-f font]"
|
||||||
" [-n name] [-o file]\n"
|
" [-g geometry] [-n name] [-o file]\n"
|
||||||
" [-T title] [-t title] [-w windowid] -l line"
|
" [-T title] [-t title] [-w windowid] -l line"
|
||||||
" [stty_args ...]\n", argv0, argv0);
|
" [stty_args ...]\n", argv0, argv0);
|
||||||
}
|
}
|
||||||
|
@ -2270,6 +2271,9 @@ main(int argc, char *argv[])
|
||||||
if (!(defaultfontsize > 0))
|
if (!(defaultfontsize > 0))
|
||||||
usage();
|
usage();
|
||||||
break;
|
break;
|
||||||
|
case 'd':
|
||||||
|
opt_dir = EARGF(usage());
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
} ARGEND;
|
} ARGEND;
|
||||||
|
@ -2289,6 +2293,7 @@ run:
|
||||||
xinit(cols, rows);
|
xinit(cols, rows);
|
||||||
xsetenv();
|
xsetenv();
|
||||||
selinit();
|
selinit();
|
||||||
|
chdir(opt_dir);
|
||||||
run();
|
run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue