Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[fix] Use the new saneopt_has for -v/--version
  • Loading branch information
Southern committed Oct 26, 2013
1 parent aebfd77 commit ed34860
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/forza.c
Expand Up @@ -200,12 +200,6 @@ int main(int argc, char *argv[]) {

#ifdef FORZA_VERSION_HASH
printf("forza %s\n", FORZA_VERSION_HASH);
// saneopt doesn't allow options without input
for (v = 0; v < argc; v++) {
if (strcmp(argv[v], "-v") == 0 || strcmp(argv[v], "--version") == 0) {
return 0;
}
}
#else
printf("forza\n");
#endif
Expand All @@ -214,6 +208,11 @@ int main(int argc, char *argv[]) {

saneopt_alias(opt, "host", "h");
saneopt_alias(opt, "port", "p");
saneopt_alias(opt, "version", "v");

if (saneopt_has(opt, "version")) {
return 0;
}

host = saneopt_get(opt, "host");
port_str = saneopt_get(opt, "port");
Expand Down

0 comments on commit ed34860

Please sign in to comment.