Remove -o and -f options

These can be specified in the configuration file now.
This commit is contained in:
Simon Ser 2021-04-21 15:41:49 +02:00 committed by danshick
parent f978a6eb77
commit 5d3cf9a8fa

View file

@ -26,12 +26,9 @@ static int xdpw_usage(FILE *stream, int rc) {
"\n" "\n"
" -l, --loglevel=<loglevel> Select log level (default is ERROR).\n" " -l, --loglevel=<loglevel> Select log level (default is ERROR).\n"
" QUIET, ERROR, WARN, INFO, DEBUG, TRACE\n" " QUIET, ERROR, WARN, INFO, DEBUG, TRACE\n"
" -o, --output=<name> Select output to capture.\n"
" metadata (performs no conversion).\n"
" -c, --config=<config file> Select config file.\n" " -c, --config=<config file> Select config file.\n"
" (default is $XDG_CONFIG_HOME/xdg-desktop-portal-wlr/config)\n" " (default is $XDG_CONFIG_HOME/xdg-desktop-portal-wlr/config)\n"
" -r, --replace Replace a running instance.\n" " -r, --replace Replace a running instance.\n"
" -f, --max-fps=<fps> Set the FPS limit (default 0, no limit).\n"
" -h, --help Get help (this text).\n" " -h, --help Get help (this text).\n"
"\n"; "\n";
@ -54,9 +51,7 @@ int main(int argc, char *argv[]) {
static const char *shortopts = "l:o:c:f:rh"; static const char *shortopts = "l:o:c:f:rh";
static const struct option longopts[] = { static const struct option longopts[] = {
{ "loglevel", required_argument, NULL, 'l' }, { "loglevel", required_argument, NULL, 'l' },
{ "output", required_argument, NULL, 'o' },
{ "config", required_argument, NULL, 'c' }, { "config", required_argument, NULL, 'c' },
{ "max-fps", required_argument, NULL, 'f' },
{ "replace", no_argument, NULL, 'r' }, { "replace", no_argument, NULL, 'r' },
{ "help", no_argument, NULL, 'h' }, { "help", no_argument, NULL, 'h' },
{ NULL, 0, NULL, 0 } { NULL, 0, NULL, 0 }
@ -72,19 +67,12 @@ int main(int argc, char *argv[]) {
case 'l': case 'l':
loglevel = get_loglevel(optarg); loglevel = get_loglevel(optarg);
break; break;
case 'o':
config.screencast_conf.output_name = strdup(optarg);
config.screencast_conf.chooser_type = XDPW_CHOOSER_NONE;
break;
case 'c': case 'c':
configfile = strdup(optarg); configfile = strdup(optarg);
break; break;
case 'r': case 'r':
replace = true; replace = true;
break; break;
case 'f':
config.screencast_conf.max_fps = atof(optarg);
break;
case 'h': case 'h':
return xdpw_usage(stdout, EXIT_SUCCESS); return xdpw_usage(stdout, EXIT_SUCCESS);
default: default:
@ -238,7 +226,7 @@ int main(int argc, char *argv[]) {
if (pollfds[EVENT_LOOP_TIMER].revents & POLLIN) { if (pollfds[EVENT_LOOP_TIMER].revents & POLLIN) {
logprint(TRACE, "event-loop: got a timer event"); logprint(TRACE, "event-loop: got a timer event");
int timer_fd = pollfds[EVENT_LOOP_TIMER].fd; int timer_fd = pollfds[EVENT_LOOP_TIMER].fd;
uint64_t expirations; uint64_t expirations;
ssize_t n = read(timer_fd, &expirations, sizeof(expirations)); ssize_t n = read(timer_fd, &expirations, sizeof(expirations));