| @@ -32,7 +32,7 @@ const options_t *options = (const options_t*) &_options; |
| 32 | 32 | | |
| 33 | 33 | | void print_usage(void) |
| 34 | 34 | | { |
| 35 | | − | printf("usage: sxiv [-abcfhioqrtvZ] [-e WID] [-G GAMMA] [-g GEOMETRY] " |
| 35 | + | printf("usage: sxiv [-abcfhioqrtvZ] [-A FRAMERATE] [-e WID] [-G GAMMA] [-g GEOMETRY] " |
| 36 | 36 | | "[-N NAME] [-n NUM] [-S DELAY] [-s MODE] [-z ZOOM] FILES...\n"); |
| 37 | 37 | | } |
| 38 | 38 | | |
| @@ -60,6 +60,7 @@ void parse_options(int argc, char **argv) |
| 60 | 60 | | _options.animate = false; |
| 61 | 61 | | _options.gamma = 0; |
| 62 | 62 | | _options.slideshow = 0; |
| 63 | + | _options.framerate = 0; |
| 63 | 64 | | |
| 64 | 65 | | _options.fullscreen = false; |
| 65 | 66 | | _options.embed = 0; |
| @@ -71,7 +72,7 @@ void parse_options(int argc, char **argv) |
| 71 | 72 | | _options.thumb_mode = false; |
| 72 | 73 | | _options.clean_cache = false; |
| 73 | 74 | | |
| 74 | | − | while ((opt = getopt(argc, argv, "abce:fG:g:hin:N:oqrS:s:tvZz:")) != -1) { |
| 75 | + | while ((opt = getopt(argc, argv, "aA:bce:fG:g:hin:N:oqrS:s:tvZz:")) != -1) { |
| 75 | 76 | | switch (opt) { |
| 76 | 77 | | case '?': |
| 77 | 78 | | print_usage(); |
| @@ -79,6 +80,13 @@ void parse_options(int argc, char **argv) |
| 79 | 80 | | case 'a': |
| 80 | 81 | | _options.animate = true; |
| 81 | 82 | | break; |
| 83 | + | case 'A': |
| 84 | + | _options.animate = true; |
| 85 | + | n = strtol(optarg, &end, 0); |
| 86 | + | if (*end != '\0' || n <= 0) |
| 87 | + | error(EXIT_FAILURE, 0, "Invalid argument for option -A: %s", optarg); |
| 88 | + | _options.framerate = n; |
| 89 | + | break; |
| 82 | 90 | | case 'b': |
| 83 | 91 | | _options.hide_bar = true; |
| 84 | 92 | | break; |