Skip to content
Permalink
Browse files

[fix] Use the new `saneopt_has` for -v/--version

  • Loading branch information...
Southern committed Oct 26, 2013
1 parent aebfd77 commit ed348600d3844bfa407bd5ab31be292f02caaecd
Showing with 5 additions and 6 deletions.
  1. +5 −6 src/forza.c
@@ -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
@@ -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");

0 comments on commit ed34860

Please sign in to comment.
You can’t perform that action at this time.