summaryrefslogtreecommitdiffstats
path: root/options.c
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-01-30 16:39:16 +0100
committerBert <ber.t@gmx.com>2011-01-30 16:39:16 +0100
commit03bfe1015e7e67104c2872bdcf085b1315b24a4c (patch)
tree4ec7420d3fe84106bb37e4329af92aca9b041543 /options.c
parente2d9463375db0ba0ac1bb62c1573715c3a084346 (diff)
downloadnsxiv-03bfe1015e7e67104c2872bdcf085b1315b24a4c.tar.zst
Explicitly enable printing of warnings
Diffstat (limited to 'options.c')
-rw-r--r--options.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/options.c b/options.c
index b0f3186..1bcfbe1 100644
--- a/options.c
+++ b/options.c
@@ -29,7 +29,7 @@ options_t _options;
const options_t *options = (const options_t*) &_options;
void print_usage() {
- printf("usage: sxiv [-dfhpsvZ] [-w WIDTH[xHEIGHT]] [-z ZOOM] FILES...\n");
+ printf("usage: sxiv [-dfhpsvWZ] [-w WIDTH[xHEIGHT]] [-z ZOOM] FILES...\n");
}
void print_version() {
@@ -50,7 +50,9 @@ void parse_options(int argc, char **argv) {
_options.winh = h = 0;
_options.fullscreen = 0;
- while ((opt = getopt(argc, argv, "dfhpsvw:Zz:")) != -1) {
+ _options.warn = 0;
+
+ while ((opt = getopt(argc, argv, "dfhpsvWw:Zz:")) != -1) {
switch (opt) {
case '?':
print_usage();
@@ -73,6 +75,9 @@ void parse_options(int argc, char **argv) {
case 'v':
print_version();
exit(0);
+ case 'W':
+ _options.warn = 1;
+ break;
case 'w':
if (!sscanf(optarg, "%hux%hu", &w, &h)) {
fprintf(stderr, "sxiv: invalid argument for option -w: %s\n",