diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-06-23 12:34:36 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-06-23 13:12:08 +0000 |
| commit | 63a64bdca1978814ade32949e4cbf0d9758e6cbe (patch) | |
| tree | 522d4170a0dcc923355b5596b30ee93d49d1689c /client.c | |
| parent | main: usage: add ‘=’ between --override and its value (diff) | |
client: implement -o,--override
Diffstat (limited to 'client.c')
| -rw-r--r-- | client.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -63,6 +63,7 @@ print_usage(const char *prog_name) " -s,--server-socket=PATH path to the server UNIX domain socket (default=$XDG_RUNTIME_DIR/foot-$WAYLAND_DISPLAY.sock)\n" " -H,--hold remain open after child process exits\n" " -N,--no-wait detach the client process from the running terminal, exiting immediately\n" + " -o,--override=[section.]key=value override configuration option\n" " -d,--log-level={info|warning|error} log level (info)\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"); @@ -91,6 +92,7 @@ main(int argc, char *const *argv) {"server-socket", required_argument, NULL, 's'}, {"hold", no_argument, NULL, 'H'}, {"no-wait", no_argument, NULL, 'N'}, + {"override", required_argument, NULL, 'o'}, {"log-level", required_argument, NULL, 'd'}, {"log-colorize", optional_argument, NULL, 'l'}, {"version", no_argument, NULL, 'v'}, @@ -115,7 +117,7 @@ main(int argc, char *const *argv) struct client_string *cargv = NULL; while (true) { - int c = getopt_long(argc, argv, "+t:T:a:w:W:mFLD:s:HNd:l::vh", longopts, NULL); + int c = getopt_long(argc, argv, "+t:T:a:w:W:mFLD:s:HNo:d:l::vh", longopts, NULL); if (c == -1) break; @@ -191,6 +193,10 @@ main(int argc, char *const *argv) no_wait = true; break; + case 'o': + tll_push_back(overrides, xstrdup(optarg)); + break; + case 'd': { int lvl = log_level_from_string(optarg); if (unlikely(lvl < 0)) { |
