nsxivf0e9ec7
Replaced option -W with -q, seems more natural
+15 −16
5 files changed
| @@ -35,9 +35,9 @@ sxiv supports the following command-line options: | |||
| 35 | 35 | -g GEOMETRY set window position and size | |
| 36 | 36 | (see section GEOMETRY SPECIFICATIONS of X(7)) | |
| 37 | 37 | -p pixelize, i.e. turn off image anti-aliasing | |
| 38 | + | -q be quiet, disable warnings | |
| 38 | 39 | -s scale all images to fit into window | |
| 39 | 40 | -v print version information and exit | |
| 40 | − | -W enable printing of warnings | |
| 41 | 41 | -Z same as `-z 100' | |
| 42 | 42 | -z ZOOM scale all images to current zoom level, use ZOOM at startup | |
| 43 | 43 | ||
| @@ -29,7 +29,7 @@ options_t _options; | |||
| 29 | 29 | const options_t *options = (const options_t*) &_options; | |
| 30 | 30 | ||
| 31 | 31 | void print_usage() { | |
| 32 | − | printf("usage: sxiv [-dfhpsvWZ] [-g GEOMETRY] [-z ZOOM] FILES...\n"); | |
| 32 | + | printf("usage: sxiv [-dfhpqsvZ] [-g GEOMETRY] [-z ZOOM] FILES...\n"); | |
| 33 | 33 | } | |
| 34 | 34 | ||
| 35 | 35 | void print_version() { | |
| @@ -48,9 +48,9 @@ void parse_options(int argc, char **argv) { | |||
| 48 | 48 | _options.fullscreen = 0; | |
| 49 | 49 | _options.geometry = NULL; | |
| 50 | 50 | ||
| 51 | − | _options.warn = 0; | |
| 51 | + | _options.quiet = 0; | |
| 52 | 52 | ||
| 53 | − | while ((opt = getopt(argc, argv, "dfg:hpsvWZz:")) != -1) { | |
| 53 | + | while ((opt = getopt(argc, argv, "dfg:hpqsvZz:")) != -1) { | |
| 54 | 54 | switch (opt) { | |
| 55 | 55 | case '?': | |
| 56 | 56 | print_usage(); | |
| @@ -70,15 +70,15 @@ void parse_options(int argc, char **argv) { | |||
| 70 | 70 | case 'p': | |
| 71 | 71 | _options.aa = 0; | |
| 72 | 72 | break; | |
| 73 | + | case 'q': | |
| 74 | + | _options.quiet = 1; | |
| 75 | + | break; | |
| 73 | 76 | case 's': | |
| 74 | 77 | _options.scalemode = SCALE_FIT; | |
| 75 | 78 | break; | |
| 76 | 79 | case 'v': | |
| 77 | 80 | print_version(); | |
| 78 | 81 | exit(0); | |
| 79 | − | case 'W': | |
| 80 | − | _options.warn = 1; | |
| 81 | − | break; | |
| 82 | 82 | case 'Z': | |
| 83 | 83 | _options.scalemode = SCALE_ZOOM; | |
| 84 | 84 | _options.zoom = 1.0; | |
| @@ -32,7 +32,7 @@ typedef struct options_s { | |||
| 32 | 32 | unsigned char fullscreen; | |
| 33 | 33 | char *geometry; | |
| 34 | 34 | ||
| 35 | − | unsigned char warn; | |
| 35 | + | unsigned char quiet; | |
| 36 | 36 | } options_t; | |
| 37 | 37 | ||
| 38 | 38 | extern const options_t *options; | |
| @@ -3,10 +3,9 @@ | |||
| 3 | 3 | sxiv \- Simple (or small or suckless) X Image Viewer | |
| 4 | 4 | .SH SYNOPSIS | |
| 5 | 5 | .B sxiv | |
| 6 | − | .RB [ \-dfhpsvWZ ] | |
| 7 | − | .RB [ \-w | |
| 8 | − | .IB WIDTH x HEIGHT | |
| 9 | − | ] | |
| 6 | + | .RB [ \-dfhpqsvZ ] | |
| 7 | + | .RB [ \-g | |
| 8 | + | .IR GEOMETRY ] | |
| 10 | 9 | .RB [ \-z | |
| 11 | 10 | .IR ZOOM ] | |
| 12 | 11 | .IR FILE ... | |
| @@ -35,15 +34,15 @@ Print brief usage information to standard output and exit. | |||
| 35 | 34 | .B \-p | |
| 36 | 35 | Pixelize images, i.e. turn off anti-aliasing. | |
| 37 | 36 | .TP | |
| 37 | + | .B \-q | |
| 38 | + | Be quiet, disable warnings to standard error stream. | |
| 39 | + | .TP | |
| 38 | 40 | .B \-s | |
| 39 | 41 | Scale all images to fit into window. | |
| 40 | 42 | .TP | |
| 41 | 43 | .B \-v | |
| 42 | 44 | Print version information to standard output and exit. | |
| 43 | 45 | .TP | |
| 44 | − | .B \-W | |
| 45 | − | Enable printing of warnings to standard error stream. | |
| 46 | − | .TP | |
| 47 | 46 | .B \-Z | |
| 48 | 47 | The same as `-z 100'. | |
| 49 | 48 | .TP | |
| @@ -28,7 +28,7 @@ | |||
| 28 | 28 | ||
| 29 | 29 | #define WARN(...) \ | |
| 30 | 30 | do { \ | |
| 31 | − | if (options->warn) { \ | |
| 31 | + | if (!options->quiet) { \ | |
| 32 | 32 | fprintf(stderr, "sxiv: %s:%d: warning: ", __FILE__, __LINE__); \ | |
| 33 | 33 | fprintf(stderr, __VA_ARGS__); \ | |
| 34 | 34 | fprintf(stderr, "\n"); \ | |