mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-17 05:33:52 -04:00
main: allow TERM to be set on the command line
This commit is contained in:
parent
7e36027237
commit
7d7af62d84
1 changed files with 7 additions and 1 deletions
8
main.c
8
main.c
|
|
@ -278,6 +278,7 @@ main(int argc, char *const *argv)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
static const struct option longopts[] = {
|
static const struct option longopts[] = {
|
||||||
|
{"term", required_argument, 0, 't'},
|
||||||
{"font", required_argument, 0, 'f'},
|
{"font", required_argument, 0, 'f'},
|
||||||
{NULL, no_argument, 0, 0},
|
{NULL, no_argument, 0, 0},
|
||||||
};
|
};
|
||||||
|
|
@ -285,11 +286,16 @@ main(int argc, char *const *argv)
|
||||||
//const char *font_name = "monospace";
|
//const char *font_name = "monospace";
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
int c = getopt_long(argc, argv, ":f:h", longopts, NULL);
|
int c = getopt_long(argc, argv, ":t:f:h", longopts, NULL);
|
||||||
if (c == -1)
|
if (c == -1)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
case 't':
|
||||||
|
free(conf.term);
|
||||||
|
conf.term = strdup(optarg);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'f':
|
case 'f':
|
||||||
free(conf.font);
|
free(conf.font);
|
||||||
conf.font = strdup(optarg);
|
conf.font = strdup(optarg);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue