From a4786e496bb0d0f4b075aafcd68d613d52135596 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 15 Apr 2005 21:05:58 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=5869 --- checkin_notes | 7 +++++++ client/cs_cmdline.C | 34 ++++++++++++++++++++-------------- doc/client_unix.php | 16 ++++++++-------- 3 files changed, 35 insertions(+), 22 deletions(-) diff --git a/checkin_notes b/checkin_notes index 7587201c87..f30fa98bfd 100755 --- a/checkin_notes +++ b/checkin_notes @@ -27256,3 +27256,10 @@ David 15 April 2005 lib/ boinc_cmd.C gui_rpc_client.C + +David 15 APril 2005 + - core client: added "-dir path" cmdline option + (chdir to the given directory at startup) + + client/ + cs_cmdline.C diff --git a/client/cs_cmdline.C b/client/cs_cmdline.C index cb10eb5388..d13659af5c 100644 --- a/client/cs_cmdline.C +++ b/client/cs_cmdline.C @@ -21,10 +21,9 @@ #ifdef _WIN32 #include "boinc_win.h" -#endif - -#ifndef _WIN32 +#else #include +#include #endif #include "main.h" @@ -35,18 +34,20 @@ static void print_options(char* prog) { printf( "Usage: %s [options]\n" - " -version show version info\n" - " -exit_when_idle Get/process/report work, then exit\n" - " -show_projects show attached projects\n" + " -help show options\n" + " -version show version info\n" + " -exit_when_idle Get/process/report work, then exit\n" + " -show_projects show attached projects\n" " -return_results_immediately contact server when have results\n" - " -detach_project URL detach from a project\n" - " -reset_project URL reset (clear) a project\n" - " -attach_project attach to a project (will prompt for URL, account key)\n" - " -update_prefs URL contact a project to update preferences\n" - " -run_cpu_benchmarks run the CPU benchmarks\n" - " -check_all_logins check input from remote users\n" - " -allow_remote_gui_rpc allow remote GUI RPC connections\n" - " -redirectio redirect stdout and stderr to log files\n", + " -detach_project URL detach from a project\n" + " -reset_project URL reset (clear) a project\n" + " -attach_project URL key attach to a project\n" + " -update_prefs URL contact a project to update preferences\n" + " -run_cpu_benchmarks run the CPU benchmarks\n" + " -check_all_logins for idle detection, check remote logins\n too" + " -allow_remote_gui_rpc allow remote GUI RPC connections\n" + " -redirectio redirect stdout and stderr to log files\n" + " -dir abs_path use given dir as BOINC home\n", prog ); } @@ -162,6 +163,11 @@ void CLIENT_STATE::parse_cmdline(int argc, char** argv) { } else if (ARG(help)) { print_options(argv[0]); exit(0); + } else if (ARG(dir)) { + if (i == argc-1) show_options = true; + if (chdir(argv[++i])) { + perror("chdir"); + } } else { printf("Unknown option: %s\n", argv[i]); show_options = true; diff --git a/doc/client_unix.php b/doc/client_unix.php index e7d51eb14a..bd003312c9 100644 --- a/doc/client_unix.php +++ b/doc/client_unix.php @@ -21,6 +21,12 @@ and for automatic startup of the core client, are

command-line options

"; list_start(); +list_item("-help", + "Show client options." +); +list_item("-version", + "Show client version." +); list_item("-attach_project URL account_key", "Attach this computer to a new project." ); @@ -37,13 +43,11 @@ list_item("-reset_project URL", Use this if there is a problem that is preventing your computer from working." ); - list_item("-update_prefs URL", "Contact a project's server to obtain new preferences. This will also report completed results and get new work if needed." ); - list_item("-return_results_immediately", "Contact scheduler as soon as any result done." ); @@ -62,12 +66,8 @@ list_item("-exit_when_idle", list_item("-allow_remote_gui_rpc", "Allow GUI RPCs from remote hosts" ); -list_item("-help", - "Show client options." -); - -list_item("-version", - "Show client version." +list_item("-dir abs_path", + "Use the given directory as BOINC home" ); list_end(); echo "