From 16ac049357d9b8e4f4f15a2953f336a78a71fcba Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 30 Apr 2014 16:53:01 -0700 Subject: [PATCH] boinccmd: add --get_project_urls command to list project URLs, one per line A script that wants to do some operation - say, update - on all projects can call this, parse the result, then do the operation on each project. --- client/boinc_cmd.cpp | 4 ++++ lib/gui_rpc_client.h | 1 + lib/gui_rpc_client_print.cpp | 7 +++++++ 3 files changed, 12 insertions(+) diff --git a/client/boinc_cmd.cpp b/client/boinc_cmd.cpp index 9b07def1cd..652aa0966b 100644 --- a/client/boinc_cmd.cpp +++ b/client/boinc_cmd.cpp @@ -250,6 +250,10 @@ int main(int argc, char** argv) { PROJECTS ps; retval = rpc.get_project_status(ps); if (!retval) ps.print(); + } else if (!strcmp(cmd, "--get_project_urls")) { + PROJECTS ps; + retval = rpc.get_project_status(ps); + if (!retval) ps.print_urls(); } else if (!strcmp(cmd, "--get_simple_gui_info")) { SIMPLE_GUI_INFO info; retval = rpc.get_simple_gui_info(info); diff --git a/lib/gui_rpc_client.h b/lib/gui_rpc_client.h index 149ad9a02b..295580cb49 100644 --- a/lib/gui_rpc_client.h +++ b/lib/gui_rpc_client.h @@ -423,6 +423,7 @@ struct PROJECTS { ~PROJECTS(); void print(); + void print_urls(); void clear(); }; diff --git a/lib/gui_rpc_client_print.cpp b/lib/gui_rpc_client_print.cpp index 9e717bc0f7..f1bd8e2d0d 100644 --- a/lib/gui_rpc_client_print.cpp +++ b/lib/gui_rpc_client_print.cpp @@ -311,6 +311,13 @@ void PROJECTS::print() { } } +void PROJECTS::print_urls() { + unsigned int i; + for (i=0; imaster_url); + } +} + void DISK_USAGE::print() { unsigned int i; printf("======== Disk usage ========\n");