|
-
-
- #define _XOPEN_SOURCE
-
- #include <stdlib.h>
- #include <stdio.h>
- #include <unistd.h>
-
- #include "sxiv.h"
- #include "options.h"
-
- options_t _options;
- const options_t *options = (const options_t*) &_options;
-
- void print_usage() {
- printf("usage: sxiv [-hv] FILES...\n");
- }
-
- void print_version() {
- printf("sxiv - simple x image viewer\n");
- printf("Version %s, written by Bert Muennich\n", VERSION);
- }
-
- void parse_options(int argc, char **argv) {
- int opt;
-
- while ((opt = getopt(argc, argv, "hv")) != -1) {
- switch (opt) {
- case '?':
- print_usage();
- exit(1);
- case 'h':
- print_usage();
- exit(0);
- case 'v':
- print_version();
- exit(0);
- }
- }
-
- _options.filenames = (const char**) argv + optind;
- _options.filecnt = argc - optind;
- }
|