nsxivfb6e4bd
Only print marked files when -o is given
Fallback to print all files, if no images are marked, was kind of irritating.
+8 −8
4 files changed
- M Makefile +1 −1
- M README.md +1 −1
- M commands.c +2 −2
- M sxiv.1 +4 −4
| @@ -1,4 +1,4 @@ | |||
| 1 | − | VERSION = git-20130810 | |
| 1 | + | VERSION = git-20130822 | |
| 2 | 2 | ||
| 3 | 3 | PREFIX = /usr/local | |
| 4 | 4 | MANPREFIX = $(PREFIX)/share/man | |
| @@ -79,7 +79,7 @@ of small previews is displayed, making it easy to choose an image to open. | |||
| 79 | 79 | -i Read file list from stdin | |
| 80 | 80 | -n NUM Start at picture NUM | |
| 81 | 81 | -N NAME Set X window resource name to NAME | |
| 82 | − | -o Write list of marked/all files to stdout when quitting | |
| 82 | + | -o Write list of marked files to stdout when quitting | |
| 83 | 83 | -p Pixelize, i.e. turn off image anti-aliasing | |
| 84 | 84 | -q Be quiet, disable warnings | |
| 85 | 85 | -r Search given directories recursively for images | |
| @@ -61,9 +61,9 @@ bool it_quit(arg_t a) | |||
| 61 | 61 | { | |
| 62 | 62 | unsigned int i; | |
| 63 | 63 | ||
| 64 | − | if (options->to_stdout) { | |
| 64 | + | if (options->to_stdout && markcnt > 0) { | |
| 65 | 65 | for (i = 0; i < filecnt; i++) { | |
| 66 | − | if (!markcnt || files[i].marked) | |
| 66 | + | if (files[i].marked) | |
| 67 | 67 | printf("%s\n", files[i].name); | |
| 68 | 68 | } | |
| 69 | 69 | } | |
| @@ -62,10 +62,10 @@ Print brief usage information to standard output and exit. | |||
| 62 | 62 | Read names of files to open from standard input. | |
| 63 | 63 | .TP | |
| 64 | 64 | .B \-o | |
| 65 | − | Write list of all marked files, or all opened files if no files are marked, to | |
| 66 | − | standard output when quitting. If combined with | |
| 67 | − | .IR \-i , | |
| 68 | − | then sxiv acts as a visual filter/pipe. | |
| 65 | + | Write list of all marked files to standard output when quitting. In combination | |
| 66 | + | with | |
| 67 | + | .I \-i | |
| 68 | + | sxiv can be used as a visual filter/pipe. | |
| 69 | 69 | .TP | |
| 70 | 70 | .B \-p | |
| 71 | 71 | Pixelize images, i.e. turn off anti-aliasing. | |