diff options
-rw-r--r-- | main.c | 3 | ||||
-rw-r--r-- | options.c | 7 | ||||
-rw-r--r-- | options.h | 2 |
3 files changed, 5 insertions, 7 deletions
@@ -50,8 +50,7 @@ void run() { } int main(int argc, char **argv) { - if (parse_options(argc, argv) < 0) - return 1; + parse_options(argc, argv); if (!options->filecnt) { print_usage(); @@ -37,7 +37,7 @@ void print_version() { printf("Version %s, written by Bert Muennich\n", VERSION); } -int parse_options(int argc, char **argv) { +void parse_options(int argc, char **argv) { int opt; _options.filenames = (const char**) argv + 1; @@ -46,7 +46,8 @@ int parse_options(int argc, char **argv) { while ((opt = getopt(argc, argv, "hv")) != -1) { switch (opt) { case '?': - return -1; + print_usage(); + exit(1); case 'h': print_usage(); exit(0); @@ -55,6 +56,4 @@ int parse_options(int argc, char **argv) { exit(0); } } - - return 0; } @@ -29,6 +29,6 @@ extern const options_t *options; void print_usage(); void print_version(); -int parse_options(int, char**); +void parse_options(int, char**); #endif /* OPTIONS_H */ |