mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-13 05:33:51 -04:00
client: add --login-shell command line option
This commit is contained in:
parent
d3071b817e
commit
8dee9bf942
1 changed files with 7 additions and 0 deletions
7
client.c
7
client.c
|
|
@ -33,6 +33,7 @@ print_usage(const char *prog_name)
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf("Options:\n");
|
printf("Options:\n");
|
||||||
printf(" -t,--term=TERM value to set the environment variable TERM to (foot)\n"
|
printf(" -t,--term=TERM value to set the environment variable TERM to (foot)\n"
|
||||||
|
" --login-shell start shell as a login shell\n"
|
||||||
" -s,--server-socket=PATH path to the server UNIX domain socket (default=XDG_RUNTIME_DIR/foot.sock)\n"
|
" -s,--server-socket=PATH path to the server UNIX domain socket (default=XDG_RUNTIME_DIR/foot.sock)\n"
|
||||||
" -l,--log-colorize=[never|always|auto] enable/disable colorization of log output on stderr\n"
|
" -l,--log-colorize=[never|always|auto] enable/disable colorization of log output on stderr\n"
|
||||||
" -v,--version show the version number and quit\n");
|
" -v,--version show the version number and quit\n");
|
||||||
|
|
@ -47,6 +48,7 @@ main(int argc, char *const *argv)
|
||||||
|
|
||||||
static const struct option longopts[] = {
|
static const struct option longopts[] = {
|
||||||
{"term", required_argument, 0, 't'},
|
{"term", required_argument, 0, 't'},
|
||||||
|
{"login-shell", no_argument, 0, 'L'},
|
||||||
{"server-socket", required_argument, 0, 's'},
|
{"server-socket", required_argument, 0, 's'},
|
||||||
{"log-colorize", optional_argument, NULL, 'l'},
|
{"log-colorize", optional_argument, NULL, 'l'},
|
||||||
{"version", no_argument, 0, 'v'},
|
{"version", no_argument, 0, 'v'},
|
||||||
|
|
@ -57,6 +59,7 @@ main(int argc, char *const *argv)
|
||||||
const char *term = "";
|
const char *term = "";
|
||||||
const char *server_socket_path = NULL;
|
const char *server_socket_path = NULL;
|
||||||
enum log_colorize log_colorize = LOG_COLORIZE_AUTO;
|
enum log_colorize log_colorize = LOG_COLORIZE_AUTO;
|
||||||
|
bool login_shell = false;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
int c = getopt_long(argc, argv, ":t:s:l::hv", longopts, NULL);
|
int c = getopt_long(argc, argv, ":t:s:l::hv", longopts, NULL);
|
||||||
|
|
@ -68,6 +71,10 @@ main(int argc, char *const *argv)
|
||||||
term = optarg;
|
term = optarg;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'L':
|
||||||
|
login_shell = true;
|
||||||
|
break;
|
||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
server_socket_path = optarg;
|
server_socket_path = optarg;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue