validator: output the version string even when not in project directory

svn path=/trunk/boinc/; revision=25345
This commit is contained in:
Bernd Machenschalk 2012-02-27 11:54:02 +00:00
parent 7de8d05277
commit df439c128b
2 changed files with 11 additions and 4 deletions

View File

@ -2221,3 +2221,8 @@ Bernd 27 feb 2012
sched/
db_purge.cpp
Bernd 27 feb 2012
- validator: output the version string even when not in project directory
sched/
validator.cpp

View File

@ -700,9 +700,14 @@ int main(int argc, char** argv) {
" -h | --help Show this\n"
" -v | --version Show version information\n";
if ((argc > 1) && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help"))) {
if (argc > 1) {
if (is_arg(argv[1], "h") || is_arg(argv[1], "help")) {
printf (usage, argv[0] );
exit(0);
} else if (is_arg(argv[1], "v") || is_arg(argv[1], "version")) {
printf("%s\n", SVN_VERSION);
exit(0);
}
}
check_stop_daemons();
@ -735,9 +740,6 @@ int main(int argc, char** argv) {
max_runtime = atof(argv[++i]);
} else if (is_arg(argv[i], "no_credit")) {
no_credit = true;
} else if (is_arg(argv[i], "v") || is_arg(argv[i], "version")) {
printf("%s\n", SVN_VERSION);
exit(0);
} else {
fprintf(stderr,
"Invalid option '%s'\nTry `%s --help` for more information\n",