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.
This commit is contained in:
David Anderson 2014-04-30 16:53:01 -07:00
parent 47410322ef
commit 16ac049357
3 changed files with 12 additions and 0 deletions

View File

@ -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);

View File

@ -423,6 +423,7 @@ struct PROJECTS {
~PROJECTS();
void print();
void print_urls();
void clear();
};

View File

@ -311,6 +311,13 @@ void PROJECTS::print() {
}
}
void PROJECTS::print_urls() {
unsigned int i;
for (i=0; i<projects.size(); i++) {
printf("%s\n", projects[i]->master_url);
}
}
void DISK_USAGE::print() {
unsigned int i;
printf("======== Disk usage ========\n");