Krolyxon
Commit f0e9ec7

Branches

Refs →

nsxivf0e9ec7

Replaced option -W with -q, seems more natural

Author
Bert
Date
2011-01-30 22:23 +0100
Parent
3d8efb2
Commit
f0e9ec733ad73147be1db2a11486d1ac803c044f

+15 −16

5 files changed

  1. M README.md +1 −1
  2. M options.c +6 −6
  3. M options.h +1 −1
  4. M sxiv.1 +6 −7
  5. M sxiv.h +1 −1
M README.md View
@@ -35,9 +35,9 @@ sxiv supports the following command-line options:
3535 -g GEOMETRY set window position and size
3636 (see section GEOMETRY SPECIFICATIONS of X(7))
3737 -p pixelize, i.e. turn off image anti-aliasing
38+ -q be quiet, disable warnings
3839 -s scale all images to fit into window
3940 -v print version information and exit
40− -W enable printing of warnings
4141 -Z same as `-z 100'
4242 -z ZOOM scale all images to current zoom level, use ZOOM at startup
4343
M options.c View
@@ -29,7 +29,7 @@ options_t _options;
2929 const options_t *options = (const options_t*) &_options;
3030
3131 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");
3333 }
3434
3535 void print_version() {
@@ -48,9 +48,9 @@ void parse_options(int argc, char **argv) {
4848 _options.fullscreen = 0;
4949 _options.geometry = NULL;
5050
51− _options.warn = 0;
51+ _options.quiet = 0;
5252
53− while ((opt = getopt(argc, argv, "dfg:hpsvWZz:")) != -1) {
53+ while ((opt = getopt(argc, argv, "dfg:hpqsvZz:")) != -1) {
5454 switch (opt) {
5555 case '?':
5656 print_usage();
@@ -70,15 +70,15 @@ void parse_options(int argc, char **argv) {
7070 case 'p':
7171 _options.aa = 0;
7272 break;
73+ case 'q':
74+ _options.quiet = 1;
75+ break;
7376 case 's':
7477 _options.scalemode = SCALE_FIT;
7578 break;
7679 case 'v':
7780 print_version();
7881 exit(0);
79− case 'W':
80− _options.warn = 1;
81− break;
8282 case 'Z':
8383 _options.scalemode = SCALE_ZOOM;
8484 _options.zoom = 1.0;
M options.h View
@@ -32,7 +32,7 @@ typedef struct options_s {
3232 unsigned char fullscreen;
3333 char *geometry;
3434
35− unsigned char warn;
35+ unsigned char quiet;
3636 } options_t;
3737
3838 extern const options_t *options;
M sxiv.1 View
@@ -3,10 +3,9 @@
33 sxiv \- Simple (or small or suckless) X Image Viewer
44 .SH SYNOPSIS
55 .B sxiv
6−.RB [ \-dfhpsvWZ ]
7−.RB [ \-w
8−.IB WIDTH x HEIGHT
9−]
6+.RB [ \-dfhpqsvZ ]
7+.RB [ \-g
8+.IR GEOMETRY ]
109 .RB [ \-z
1110 .IR ZOOM ]
1211 .IR FILE ...
@@ -35,15 +34,15 @@ Print brief usage information to standard output and exit.
3534 .B \-p
3635 Pixelize images, i.e. turn off anti-aliasing.
3736 .TP
37+.B \-q
38+Be quiet, disable warnings to standard error stream.
39+.TP
3840 .B \-s
3941 Scale all images to fit into window.
4042 .TP
4143 .B \-v
4244 Print version information to standard output and exit.
4345 .TP
44−.B \-W
45−Enable printing of warnings to standard error stream.
46−.TP
4746 .B \-Z
4847 The same as `-z 100'.
4948 .TP
M sxiv.h View
@@ -28,7 +28,7 @@
2828
2929 #define WARN(...) \
3030 do { \
31− if (options->warn) { \
31+ if (!options->quiet) { \
3232 fprintf(stderr, "sxiv: %s:%d: warning: ", __FILE__, __LINE__); \
3333 fprintf(stderr, __VA_ARGS__); \
3434 fprintf(stderr, "\n"); \