From df439c128b983733f5eb8be397cb26bc10abf61f Mon Sep 17 00:00:00 2001 From: Bernd Machenschalk Date: Mon, 27 Feb 2012 11:54:02 +0000 Subject: [PATCH] validator: output the version string even when not in project directory svn path=/trunk/boinc/; revision=25345 --- checkin_notes | 5 +++++ sched/validator.cpp | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/checkin_notes b/checkin_notes index dcdaa3631c..bf39124790 100644 --- a/checkin_notes +++ b/checkin_notes @@ -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 diff --git a/sched/validator.cpp b/sched/validator.cpp index 310052400f..6705a1ed31 100644 --- a/sched/validator.cpp +++ b/sched/validator.cpp @@ -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",