Can set the presentation window size with -W and -H.

master
Zed A. Shaw 3 weeks ago
parent e33d989b9e
commit 9734b6740e
  1. 10
      src/options.cpp

@ -3,14 +3,14 @@
#include <unistd.h> #include <unistd.h>
void print_usage() { void print_usage() {
fmt::println("USAGE: bezos [-p PORT] [-h] -d deck.md"); fmt::println("USAGE: bezos [-W width] [-H height] [-p PORT] [-h] -d deck.md");
} }
Options parse_options(int argc, char* argv[]) { Options parse_options(int argc, char* argv[]) {
int opt = 0; int opt = 0;
Options result; Options result;
while((opt = getopt(argc, argv, "hp:d:")) != -1) { while((opt = getopt(argc, argv, "hp:d:W:H:")) != -1) {
switch(opt) { switch(opt) {
case 'h': case 'h':
print_usage(); print_usage();
@ -23,6 +23,12 @@ Options parse_options(int argc, char* argv[]) {
result.deck_given=true; result.deck_given=true;
result.deck_file = optarg; result.deck_file = optarg;
break; break;
case 'W':
result.pres_size.x = std::stoi(optarg);
break;
case 'H':
result.pres_size.y = std::stoi(optarg);
break;
default: default:
print_usage(); print_usage();
return {.error=true}; return {.error=true};

Loading…
Cancel
Save