| @@ -33,7 +33,7 @@ const options_t *options = (const options_t*) &_options; |
| 33 | 33 | | void print_usage(void) |
| 34 | 34 | | { |
| 35 | 35 | | printf("usage: sxiv [-abcfhioqrtvZ] [-G GAMMA] [-g GEOMETRY] [-n NUM] " |
| 36 | | − | "[-N NAME] [-S DELAY] [-s MODE] [-z ZOOM] FILES...\n"); |
| 36 | + | "[-N NAME] [-S DELAY] [-s MODE] [-z ZOOM] [-w WID] FILES...\n"); |
| 37 | 37 | | } |
| 38 | 38 | | |
| 39 | 39 | | void print_version(void) |
| @@ -62,6 +62,7 @@ void parse_options(int argc, char **argv) |
| 62 | 62 | | _options.slideshow = 0; |
| 63 | 63 | | |
| 64 | 64 | | _options.fullscreen = false; |
| 65 | + | _options.embed = 0; |
| 65 | 66 | | _options.hide_bar = false; |
| 66 | 67 | | _options.geometry = NULL; |
| 67 | 68 | | _options.res_name = NULL; |
| @@ -70,7 +71,7 @@ void parse_options(int argc, char **argv) |
| 70 | 71 | | _options.thumb_mode = false; |
| 71 | 72 | | _options.clean_cache = false; |
| 72 | 73 | | |
| 73 | | − | while ((opt = getopt(argc, argv, "abcfG:g:hin:N:oqrS:s:tvZz:")) != -1) { |
| 74 | + | while ((opt = getopt(argc, argv, "abcfG:g:hin:N:oqrS:s:tvw:Zz:")) != -1) { |
| 74 | 75 | | switch (opt) { |
| 75 | 76 | | case '?': |
| 76 | 77 | | print_usage(); |
| @@ -138,6 +139,12 @@ void parse_options(int argc, char **argv) |
| 138 | 139 | | case 'v': |
| 139 | 140 | | print_version(); |
| 140 | 141 | | exit(EXIT_SUCCESS); |
| 142 | + | case 'w': |
| 143 | + | n = strtol(optarg, &end, 0); |
| 144 | + | if (*end != '\0') |
| 145 | + | error(EXIT_FAILURE, 0, "Invalid argument for option -w: %s", optarg); |
| 146 | + | _options.embed = n; |
| 147 | + | break; |
| 141 | 148 | | case 'Z': |
| 142 | 149 | | _options.scalemode = SCALE_ZOOM; |
| 143 | 150 | | _options.zoom = 1.0; |