From 5cb98247a3594fff9437d16aee16e0ae4a043f0a Mon Sep 17 00:00:00 2001 From: Bernd Machenschalk Date: Fri, 16 Jul 2010 07:15:57 +0000 Subject: [PATCH] validator, assimilator: added --help and --version svn path=/trunk/boinc/; revision=21966 --- checkin_notes | 8 ++++++++ sched/assimilator.cpp | 6 ++++++ sched/validator.cpp | 11 ++++++++--- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/checkin_notes b/checkin_notes index 704a56056d..caa3a71ba8 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5171,3 +5171,11 @@ David 15 Jul 2010 client/ work_fetch.h + +Bernd 15 July 2010 + - validator, assimilator: added --help and --version + + sched/ + validator.cpp + assimilator.cpp + diff --git a/sched/assimilator.cpp b/sched/assimilator.cpp index 84b1f3b6a1..89f7938a8d 100644 --- a/sched/assimilator.cpp +++ b/sched/assimilator.cpp @@ -33,6 +33,7 @@ #include "util.h" #include "error_numbers.h" #include "str_util.h" +#include "svn_version.h" #include "sched_config.h" #include "sched_util.h" @@ -70,6 +71,8 @@ void usage(char** argv) { " [-d | --debug_level N] Set verbosity level (1 to 4)\n" " [--dont_update_db] Don't update DB (for testing)\n" " [--noinsert] Don't insert records in app-specific DB\n", + " [-h | --help] Show this\n" + " [-v | --version] Show version information\n", argv[0] ); exit(0); @@ -236,6 +239,9 @@ int main(int argc, char** argv) { wu_id_remainder = atoi(argv[++i]); } else if (is_arg(argv[i], "help") || is_arg(argv[i], "h")) { usage(argv); + } else if (is_arg(argv[i], "v") || is_arg(argv[i], "version")) { + printf("%s\n", SVN_VERSION); + exit(0); } else { log_messages.printf(MSG_CRITICAL, "Unrecognized arg: %s\n", argv[i]); usage(argv); diff --git a/sched/validator.cpp b/sched/validator.cpp index aad26319ee..2dc835c16c 100644 --- a/sched/validator.cpp +++ b/sched/validator.cpp @@ -40,6 +40,7 @@ #include "util.h" #include "str_util.h" #include "error_numbers.h" +#include "svn_version.h" #include "credit.h" #include "sched_config.h" @@ -654,14 +655,15 @@ int main(int argc, char** argv) { " --update_credited_job Add record to credited_job table after granting credit\n" " --credit_from_wu Credit is specified in WU XML\n" " --sleep_interval n Set sleep-interval to n\n" - " -d n, --debug_level n Set log verbosity level, 1-4\n\n"; + " -d n, --debug_level n Set log verbosity level, 1-4\n" + " -h | --help Show this\n" + " -v | --version Show version information\n"; if ((argc > 1) && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help"))) { printf (usage, argv[0] ); - exit(1); + exit(0); } - check_stop_daemons(); for (i=1; i