mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05: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;
|
||||
|
||||
static const struct option longopts[] = {
|
||||
{"term", required_argument, 0, 't'},
|
||||
{"font", required_argument, 0, 'f'},
|
||||
{NULL, no_argument, 0, 0},
|
||||
};
|
||||
|
|
@ -285,11 +286,16 @@ main(int argc, char *const *argv)
|
|||
//const char *font_name = "monospace";
|
||||
|
||||
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)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
case 't':
|
||||
free(conf.term);
|
||||
conf.term = strdup(optarg);
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
free(conf.font);
|
||||
conf.font = strdup(optarg);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue