X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=src%2Fmain.c;h=49c0eebef26c89ac355929f1ee42ee747d007161;hb=c093b8dd5e29a2afb22988023d32261be1d41978;hp=3279400f9d6897586576a2de2639b50e22c8575d;hpb=3a525af596a8322c91c350ed4339cd1655c461b7;p=smdp.git diff --git a/src/main.c b/src/main.c index 3279400..49c0eeb 100644 --- a/src/main.c +++ b/src/main.c @@ -32,14 +32,10 @@ void usage() { fprintf(stderr, "%s", " -d, --debug enable debug messages on STDERR\n"); fprintf(stderr, "%s", " add it multiple times to increases debug level\n"); fprintf(stderr, "%s", " -e, --expand enable character entity expansion\n"); - fprintf(stderr, "%s", " -f, --nofade disable color fading in 256 color mode\n"); fprintf(stderr, "%s", " -h, --help display this help and exit\n"); - fprintf(stderr, "%s", " -i, --invert swap black and white color\n"); - fprintf(stderr, "%s", " -t, --notrans disable transparency in transparent terminal\n"); fprintf(stderr, "%s", " -s, --noslidenum do not show slide number at the bottom\n"); fprintf(stderr, "%s", " -v, --version display the version number and license\n"); fprintf(stderr, "%s", " -x, --noslidemax show slide number, but not total number of slides\n"); - fprintf(stderr, "%s", " -c, --nocodebg don't change the background color of code blocks\n"); fprintf(stderr, "%s", "\nWith no FILE, or when FILE is -, read standard input.\n\n"); exit(EXIT_FAILURE); } @@ -55,27 +51,19 @@ void version() { } int main(int argc, char *argv[]) { - int notrans = 0; // disable transparency - int nofade = 0; // disable fading - int invert = 0; // invert color (black on white) int noexpand = 1; // disable character entity expansion int reload = 0; // reload page N (0 means no reload) int noreload = 1; // reload disabled until we know input is a file int slidenum = 2; // 0:don't show; 1:show #; 2:show #/# - int nocodebg = 0; // 0:show code bg as inverted; 1: don't invert code bg // define command-line options struct option longopts[] = { { "debug", no_argument, 0, 'd' }, { "expand", no_argument, 0, 'e' }, - { "nofade", no_argument, 0, 'f' }, { "help", no_argument, 0, 'h' }, - { "invert", no_argument, 0, 'i' }, - { "notrans", no_argument, 0, 't' }, { "version", no_argument, 0, 'v' }, { "noslidenum", no_argument, 0, 's' }, { "noslidemax", no_argument, 0, 'x' }, - { "nocodebg", no_argument, 0, 'c' }, { 0, 0, 0, 0 } }; @@ -85,14 +73,10 @@ int main(int argc, char *argv[]) { switch(opt) { case 'd': debug += 1; break; case 'e': noexpand = 0; break; - case 'f': nofade = 1; break; case 'h': usage(); break; - case 'i': invert = 1; break; - case 't': notrans = 1; break; case 'v': version(); break; case 's': slidenum = 0; break; case 'x': slidenum = 1; break; - case 'c': nocodebg = 1; break; case ':': fprintf(stderr, "%s: '%c' requires an argument\n", argv[0], optopt); usage(); break; case '?': default : fprintf(stderr, "%s: option '%c' is invalid\n", argv[0], optopt); usage(); break; @@ -167,7 +151,7 @@ int main(int argc, char *argv[]) { markdown_debug(deck, debug); } - reload = ncurses_display(deck, notrans, nofade, invert, reload, noreload, slidenum, nocodebg); + reload = ncurses_display(deck, reload, noreload, slidenum); free_deck(deck);