Made parse_options void

This commit is contained in:
Bert 2011-01-19 18:16:44 +01:00
parent 6851d5c4e5
commit 8b3b28300f
3 changed files with 5 additions and 7 deletions

3
main.c
View File

@ -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();

View File

@ -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;
}

View File

@ -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 */