00001
00002
00006 #ifndef __BRORG_FUNCTIONS_H__
00007 #define __BRORG_FUNCTIONS_H__
00008 #include "SheppCommandFunctions.H"
00009
00010 #include "BrOrgCheck.H"
00011 #include "BrOrgInfo.H"
00012 #include "BrOrgCreate.H"
00013 #include "BrOrgUpdate.H"
00014
00016
00021 int cmd_brorg_help(string error_msg, string specific = "")
00022 {
00023 if (error_msg != "") {
00024 printf("error: %s\n", error_msg.c_str());
00025 }
00026
00027 printf("brorg command syntax help:\n");
00028 printf("\n");
00029
00030 if (specific == "" || specific == "check") {
00031 printf(" check <brorg1> [brorg2 ... brorgN]\n");
00032 printf("\n");
00033 }
00034 if (specific == "" || specific == "info") {
00035 printf(" info <brorg> [-auth authInfoPw]\n");
00036 printf("\n");
00037 }
00038 if (specific == "" || specific == "transfer") {
00039 printf(" transfer: not implemented\n");
00040 printf("\n");
00041 }
00042 if (specific == "" || specific == "create") {
00043 printf(" create <brorg>\n");
00044 printf(" [-postalInfo <type> <-name \"BrOrg Name\"> "
00045 "[-org \"Org Name\"]\n");
00046 printf(" <-street1 \"address street/line 1\"> "
00047 "[-street2 \"address number/line 2\"]\n");
00048 printf(" [-street3 \"address line 3\"] <-city \"City Name\"> "
00049 "[-state \"State or Province\"]\n");
00050 printf(" [-pc \"postal code\"] <-cc country-code> ...]\n");
00051 printf(" <-voice number:ext> [-fax number:ext]\n");
00052 printf(" <-email emailAddr> [-auth authInfoPw]\n");
00053 printf(" [-disclose opt,opt,...] "
00054 " [-responsible \"Responsible Name\"]\n"
00055 " -contact key=value[,key=value,...]\n");
00056 printf("\n");
00057 printf(" available values for opt:\n");
00058 printf(" {name_int name_loc org_int org_loc addr_int addr_loc "
00059 "voice fax email}\n");
00060 printf("\n");
00061 }
00062 if (specific == "" || specific == "delete") {
00063 printf(" delete: not implemented\n");
00064 printf("\n");
00065 }
00066 if (specific == "" || specific == "renew") {
00067 printf(" renew: not implemented\n");
00068 printf("\n");
00069 }
00070 if (specific == "" || specific == "update") {
00071 printf(" update <brorg> [-add-status st1,...,stN] "
00072 "[-rem-status st1,...,stN]\n");
00073 printf(" [-postalInfo <type> [-name \"BrOrg Name\"] "
00074 "[-org \"Org Name\"]\n");
00075 printf(" [-street1 \"address street/line 1\"] "
00076 "[-street2 \"address number/line 2\"]\n");
00077 printf(" [-street3 \"address line 3\"] [-city \"City Name\"] "
00078 "[-state \"State or Province\"]\n");
00079 printf(" [-pc \"postal code\"] [-cc country-code] ...]\n");
00080 printf(" [-voice number:ext] [-fax number:ext]\n");
00081 printf(" [-email emailAddr] [-auth authInfoPw] "
00082 "[-disclose opt,opt,...]\n");
00083 printf(" [-responsible \"Responsible Name\"]\n");
00084 printf(" [-exdate expirationDate]\n");
00085 printf(" [-add-contact key=value[,key=value,...]\n");
00086 printf(" [-rem-contact key=value[,key=value,...]\n");
00087 printf("\n");
00088 printf(" available values for opt:\n");
00089 printf(" {name_int name_loc org_int org_loc addr_int addr_loc "
00090 "voice fax email}\n");
00091 printf("\n");
00092 }
00093
00094 if (error_msg != "") {
00095 return -1;
00096 }
00097
00098 return 0;
00099 }
00100
00102
00106 int cmd_brorg_check(vector<string> &args)
00107 {
00108 BrOrgCheck act;
00109 BrOrgCheckCmd *cmd = act.get_command();
00110 string cmd_name = "check";
00111
00112 string id;
00113 int counter = 0;
00114 while (!args.empty()) {
00115 string numbers = SheppStrUtil::doc2id(args[0]);
00116 cmd->insert_id(numbers);
00117 cmd->insert_organization(numbers, args[0]);
00118 args.erase(args.begin());
00119 counter++;
00120 }
00121
00122 if (cmd->get_id_list().empty() || cmd->get_organization_list().empty()) {
00123 return cmd_brorg_help("no brorg specified", cmd_name);
00124 }
00125
00126 if (_debug) {
00127 map<string, string, less<string> > brorgs = cmd->get_organization_list();
00128 map<string, string, less<string> >::const_iterator it;
00129 printf("brorgs to be checked:\n");
00130 for (it = brorgs.begin(); it != brorgs.end(); it++) {
00131 printf(" id: [%s] org: [%s]\n", (*it).first.c_str(),
00132 (*it).second.c_str());
00133 }
00134 }
00135
00136 if (process_action(act) != 0) {
00137 return -1;
00138 }
00139
00140 return 0;
00141 }
00142
00144
00148 int cmd_brorg_info(vector<string> &args)
00149 {
00150 BrOrgInfo act;
00151 BrOrgInfoCmd *cmd = act.get_command();
00152 string cmd_name = "info";
00153
00154 if (args.empty()) {
00155 return cmd_brorg_help("no brorg specified", cmd_name);
00156 }
00157
00158 cmd->set_id(SheppStrUtil::doc2id(args[0]));
00159 cmd->set_organization(args[0]);
00160 args.erase(args.begin());
00161
00162 while (!args.empty()) {
00163 if (args[0] == "-auth") {
00164
00165 AuthInfo auth;
00166 if (SheppObjSet::authInfo(auth, args) != 0) {
00167 return cmd_brorg_help("invalid auth", cmd_name);
00168 }
00169
00170
00171 if (auth.get_roid_f() == true) {
00172 return cmd_contact_help("invalid auth", cmd_name);
00173 }
00174
00175 cmd->set_authInfo(auth);
00176 } else {
00177 return cmd_brorg_help("invalid syntax near \"" + args[0] + "\"",
00178 cmd_name);
00179 }
00180
00181 }
00182
00183 if (_debug) {
00184 printf("id to get info: [%s]\n", cmd->get_id().c_str());
00185 printf("org to get info: [%s]\n", cmd->get_organization().c_str());
00186 SheppPrint::authInfo(cmd->get_authInfo());
00187 }
00188
00189 if (process_action(act) != 0) {
00190 return -1;
00191 }
00192
00193 return 0;
00194 }
00195
00197
00201 int cmd_brorg_transfer(vector<string> &args)
00202 {
00203 string cmd_name = "transfer";
00204 return cmd_brorg_help("", cmd_name);
00205 }
00206
00208
00212 int cmd_brorg_create(vector<string> &args)
00213 {
00214 BrOrgCreate act;
00215 BrOrgCreateCmd *cmd = act.get_command();
00216 string cmd_name = "create";
00217
00218 if (args.empty()) {
00219 return cmd_brorg_help("no brorg specified", cmd_name);
00220 }
00221
00222 CommonData common_data;
00223
00224 common_data.set_id(SheppStrUtil::doc2id(args[0]));
00225 cmd->set_organization(args[0]);
00226
00227 args.erase(args.begin());
00228
00229
00230 AuthInfo auth;
00231 cmd->set_authInfo(auth);
00232
00233 while (!args.empty()) {
00234 if (args[0] == "-postalInfo") {
00235
00236 args.erase(args.begin());
00237 if (args.empty()) {
00238 return cmd_brorg_help("missing postal info arguments", cmd_name);
00239 }
00240 PostalInfo postal;
00241 string error_msg;
00242 if (SheppObjSet::postalInfo(postal, args, error_msg, false) != 0) {
00243 return cmd_brorg_help(error_msg, cmd_name);
00244 }
00245 vector<PostalInfo> postal_list = common_data.get_postal_info();
00246 for (int i = 0; i < (int) postal_list.size(); i++) {
00247 if (postal_list[i].get_type() == postal.get_type()) {
00248 return cmd_brorg_help("duplicated postal info type", cmd_name);
00249 }
00250 }
00251 common_data.insert_postal_info(postal);
00252 } else if (args[0] == "-voice") {
00253
00254 args.erase(args.begin());
00255 CommonData::Phone phone;
00256 if (SheppObjSet::phone(phone, args) != 0) {
00257 return cmd_brorg_help("error setting voice telephone number",
00258 cmd_name);
00259 }
00260 common_data.set_voice(phone);
00261 } else if (args[0] == "-fax") {
00262
00263 args.erase(args.begin());
00264 CommonData::Phone phone;
00265 if (SheppObjSet::phone(phone, args) != 0) {
00266 return cmd_brorg_help("error setting fax telephone number",
00267 cmd_name);
00268 }
00269 common_data.set_fax(phone);
00270 } else if (args[0] == "-email") {
00271
00272 args.erase(args.begin());
00273 if (args.empty()) {
00274 return cmd_brorg_help("no e-mail address specified", cmd_name);
00275 }
00276 common_data.set_email(args[0]);
00277 args.erase(args.begin());
00278 } else if (args[0] == "-auth") {
00279
00280 AuthInfo auth;
00281 if (SheppObjSet::authInfo(auth, args) != 0) {
00282 return cmd_brorg_help("invalid auth", cmd_name);
00283 }
00284
00285
00286 if (auth.get_roid_f() == true) {
00287 return cmd_contact_help("invalid auth", cmd_name);
00288 }
00289
00290 cmd->set_authInfo(auth);
00291 } else if (args[0] == "-disclose") {
00292
00293 args.erase(args.begin());
00294 CommonData::Disclose disclose;
00295 if (SheppObjSet::disclose(disclose, args[0]) != 0) {
00296 return cmd_brorg_help("invalid diclose information", cmd_name);
00297 }
00298 args.erase(args.begin());
00299 common_data.set_disclose(disclose);
00300 } else if (args[0] == "-contact") {
00301
00302 args.erase(args.begin());
00303 if (args.empty()) {
00304 return cmd_brorg_help("-contact requires an argument", cmd_name);
00305 }
00306 map<string, string, less<string> > my_contacts;
00307 string error_msg;
00308 if (SheppObjSet::contacts(my_contacts, args[0], error_msg) != 0) {
00309 return cmd_brorg_help(error_msg, cmd_name);
00310 }
00311 map<string, string, less<string> >::const_iterator it;
00312 for (it = my_contacts.begin(); it != my_contacts.end(); it++) {
00313 cmd->insert_contact((*it).first, (*it).second);
00314 }
00315 args.erase(args.begin());
00316 } else if (args[0] == "-responsible") {
00317
00318 args.erase(args.begin());
00319 if (args.empty()) {
00320 return cmd_brorg_help("unspecified responsible name", cmd_name);
00321 }
00322 string responsible_name = args[0];
00323 args.erase(args.begin());
00324 if (SheppStrUtil::quote_gathering(args, responsible_name) != 0) {
00325 return cmd_brorg_help("error setting responsible name", cmd_name);
00326 }
00327 cmd->set_responsible(responsible_name);
00328 } else {
00329 return cmd_brorg_help("invalid syntax near \"" + args[0] + "\"",
00330 cmd_name);
00331 }
00332 }
00333
00334 if (common_data.get_postal_info().empty()) {
00335 return cmd_brorg_help("at least one postal info must be entered",
00336 cmd_name);
00337 }
00338
00339 if (common_data.get_email() == "") {
00340 return cmd_brorg_help("e-mail is mandatory", cmd_name);
00341 }
00342
00343 if (common_data.get_voice().number == "") {
00344 return cmd_brorg_help("voice telephone number is mandatory", cmd_name);
00345 }
00346
00347 if (cmd->get_organization() == "") {
00348 return cmd_brorg_help("orgid unset", cmd_name);
00349 }
00350
00351 if (cmd->get_contact_list().empty()) {
00352 return cmd_brorg_help("at least one contact must be entered", cmd_name);
00353 }
00354
00355 cmd->set_common_data(common_data);
00356
00357 if (_debug) {
00358 printf(" brorg: [%s]\n", cmd->get_common_data().get_id().c_str());
00359
00360 vector<PostalInfo>::const_iterator it;
00361 vector<PostalInfo> postal_list;
00362 postal_list = cmd->get_common_data().get_postal_info();
00363 for (it = postal_list.begin(); it != postal_list.end(); it++) {
00364 SheppPrint::postal_info((*it));
00365 }
00366
00367 if (cmd->get_common_data().get_voice().number != "") {
00368 printf(" voice:");
00369 SheppPrint::phone(cmd->get_common_data().get_voice());
00370 }
00371
00372 if (cmd->get_common_data().get_fax().number != "") {
00373 printf(" fax :");
00374 SheppPrint::phone(cmd->get_common_data().get_fax());
00375 }
00376
00377 printf(" email: [%s]\n", cmd->get_common_data().get_email().c_str());
00378
00379 SheppPrint::authInfo(cmd->get_authInfo());
00380
00381 if (cmd->get_common_data().get_disclose().is_set()) {
00382 SheppPrint::disclose(cmd->get_common_data().get_disclose());
00383 }
00384
00385
00386 printf(" orgid: [%s]\n", cmd->get_organization().c_str());
00387
00388 map<string, string, less<string> > contacts = cmd->get_contact_list();
00389 map<string, string, less<string> >::const_iterator c_it;
00390 for (c_it = contacts.begin(); c_it != contacts.end(); c_it++) {
00391 printf(" contact[%s] = [%s]\n", (*c_it).first.c_str(),
00392 (*c_it).second.c_str());
00393 }
00394 }
00395
00396 if (process_action(act) != 0) {
00397 return -1;
00398 }
00399
00400 return 0;
00401 }
00402
00404
00408 int cmd_brorg_delete(vector<string> &args)
00409 {
00410 string cmd_name = "delete";
00411 return cmd_brorg_help("", cmd_name);
00412 }
00413
00415
00419 int cmd_brorg_renew(vector<string> &args)
00420 {
00421 string cmd_name = "renew";
00422 return cmd_brorg_help("", cmd_name);
00423 }
00424
00426
00430 int cmd_brorg_update(vector<string> &args)
00431 {
00432 BrOrgUpdate act;
00433 BrOrgUpdateCmd *cmd = act.get_command();
00434 string cmd_name = "update";
00435
00436 if (args.empty()) {
00437 return cmd_brorg_help("no brorg specified", cmd_name);
00438 }
00439
00440 CommonData common_data;
00441 common_data.set_id(SheppStrUtil::doc2id(args[0]));
00442
00443 cmd->set_organization(args[0]);
00444 args.erase(args.begin());
00445
00446 while (!args.empty()) {
00447 if (args[0] == "-add-status") {
00448
00449 args.erase(args.begin());
00450 if (args.empty()) {
00451 return cmd_brorg_help("error setting add-status", cmd_name);
00452 }
00453 string tmp1 = args[0];
00454 string tmp2;
00455 while (SheppStrUtil::split(tmp1, tmp1, tmp2, ",", true) == 0) {
00456 cmd->insert_status_list_add(tmp1);
00457 if (tmp2 == "") {
00458 break;
00459 }
00460 tmp1 = tmp2;
00461 }
00462 args.erase(args.begin());
00463 } else if (args[0] == "-rem-status") {
00464
00465 args.erase(args.begin());
00466 if (args.empty()) {
00467 return cmd_brorg_help("error setting rem-status", cmd_name);
00468 }
00469 string tmp1 = args[0];
00470 string tmp2;
00471 while (SheppStrUtil::split(tmp1, tmp1, tmp2, ",", true) == 0) {
00472 cmd->insert_status_list_rem(tmp1);
00473 if (tmp2 == "") {
00474 break;
00475 }
00476 tmp1 = tmp2;
00477 }
00478 args.erase(args.begin());
00479 } else if (args[0] == "-postalInfo") {
00480
00481 args.erase(args.begin());
00482 if (args.empty()) {
00483 return cmd_brorg_help("missing postal info arguments", cmd_name);
00484 }
00485 PostalInfo postal;
00486 string error_msg;
00487 if (SheppObjSet::postalInfo(postal, args, error_msg, true) != 0) {
00488 return cmd_brorg_help(error_msg, cmd_name);
00489 }
00490 vector<PostalInfo> postal_list = common_data.get_postal_info();
00491 for (int i = 0; i < (int) postal_list.size(); i++) {
00492 if (postal_list[i].get_type() == postal.get_type()) {
00493 return cmd_brorg_help("duplicated postal info type", cmd_name);
00494 }
00495 }
00496 common_data.insert_postal_info(postal);
00497 } else if (args[0] == "-voice") {
00498
00499 args.erase(args.begin());
00500 CommonData::Phone phone;
00501 if (SheppObjSet::phone(phone, args) != 0) {
00502 return cmd_brorg_help("error setting voice telephone number",
00503 cmd_name);
00504 }
00505 common_data.set_voice(phone);
00506 } else if (args[0] == "-fax") {
00507
00508 args.erase(args.begin());
00509 CommonData::Phone phone;
00510 if (SheppObjSet::phone(phone, args) != 0) {
00511 return cmd_brorg_help("error setting fax telephone number",
00512 cmd_name);
00513 }
00514 common_data.set_fax(phone);
00515 } else if (args[0] == "-email") {
00516
00517 args.erase(args.begin());
00518 if (args.empty()) {
00519 return cmd_brorg_help("no e-mail address specified", cmd_name);
00520 }
00521 common_data.set_email(args[0]);
00522 args.erase(args.begin());
00523 } else if (args[0] == "-auth") {
00524
00525 AuthInfo auth;
00526 if (SheppObjSet::authInfo(auth, args) != 0) {
00527 return cmd_brorg_help("invalid auth", cmd_name);
00528 }
00529
00530
00531 if (auth.get_roid_f() == true) {
00532 return cmd_brorg_help("invalid auth", cmd_name);
00533 }
00534
00535 cmd->set_authInfo(auth);
00536 } else if (args[0] == "-disclose") {
00537
00538 args.erase(args.begin());
00539 CommonData::Disclose disclose;
00540 if (SheppObjSet::disclose(disclose, args[0]) != 0) {
00541 return cmd_brorg_help("invalid diclose information", cmd_name);
00542 }
00543 args.erase(args.begin());
00544 common_data.set_disclose(disclose);
00545 } else if (args[0] == "-add-contact") {
00546
00547 args.erase(args.begin());
00548 if (args.empty()) {
00549 return cmd_brorg_help("-add-contact requires an argument",
00550 cmd_name);
00551 }
00552 map<string, string, less<string> > my_contacts;
00553 string error_msg;
00554 if (SheppObjSet::contacts(my_contacts, args[0], error_msg) != 0) {
00555 return cmd_brorg_help(error_msg, cmd_name);
00556 }
00557 map<string, string, less<string> >::const_iterator it;
00558 for (it = my_contacts.begin(); it != my_contacts.end(); it++) {
00559 cmd->insert_contact_add((*it).first, (*it).second);
00560 }
00561 args.erase(args.begin());
00562 } else if (args[0] == "-rem-contact") {
00563
00564 args.erase(args.begin());
00565 if (args.empty()) {
00566 return cmd_brorg_help("-rem-contact requires an argument",
00567 cmd_name);
00568 }
00569 map<string, string, less<string> > my_contacts;
00570 string error_msg;
00571 if (SheppObjSet::contacts(my_contacts, args[0], error_msg) != 0) {
00572 return cmd_brorg_help(error_msg, cmd_name);
00573 }
00574 map<string, string, less<string> >::const_iterator it;
00575 for (it = my_contacts.begin(); it != my_contacts.end(); it++) {
00576 cmd->insert_contact_rem((*it).first, (*it).second);
00577 }
00578 args.erase(args.begin());
00579
00580 } else if (args[0] == "-responsible") {
00581
00582 args.erase(args.begin());
00583 if (args.empty()) {
00584 return cmd_brorg_help("unspecified responsible name", cmd_name);
00585 }
00586 string responsible_name = args[0];
00587 args.erase(args.begin());
00588 if (SheppStrUtil::quote_gathering(args, responsible_name) != 0) {
00589 return cmd_brorg_help("error setting responsible name", cmd_name);
00590 }
00591 cmd->set_responsible(responsible_name);
00592 } else if (args[0] == "-exdate") {
00593
00594 args.erase(args.begin());
00595 if (args.empty()) {
00596 return cmd_brorg_help("unspecified expiration date", cmd_name);
00597 }
00598 cmd->set_exDate(args[0]);
00599 args.erase(args.begin());
00600 } else {
00601 return cmd_brorg_help("invalid syntax near \"" + args[0] + "\"",
00602 cmd_name);
00603 }
00604 }
00605
00606 if (cmd->get_status_list_add().empty() &&
00607 cmd->get_status_list_rem().empty() &&
00608 common_data.get_postal_info().empty() &&
00609 common_data.get_voice().number == "" &&
00610 common_data.get_fax().number == "" &&
00611 common_data.get_email() == "" &&
00612 cmd->get_authInfo().get_pw() == "" &&
00613 !common_data.get_disclose().is_set() &&
00614 cmd->get_organization() == "") {
00615 return cmd_brorg_help("not enough information for update", cmd_name);
00616 }
00617
00618 cmd->set_common_data(common_data);
00619
00620 if (_debug) {
00621 printf(" brorg: [%s]\n", cmd->get_common_data().get_id().c_str());
00622
00623 set<string> status = cmd->get_status_list_add();
00624 set<string>::const_iterator st_it;
00625 if (!status.empty()) {
00626 printf(" status to add: [ ");
00627 for (st_it = status.begin(); st_it != status.end(); st_it++) {
00628 printf("%s ", (*st_it).c_str());
00629 }
00630 printf("]\n");
00631 }
00632
00633 status = cmd->get_status_list_rem();
00634 if (!status.empty()) {
00635 printf(" status to rem: [ ");
00636 for (st_it = status.begin(); st_it != status.end(); st_it++) {
00637 printf("%s ", (*st_it).c_str());
00638 }
00639 printf("]\n");
00640 }
00641
00642 vector<PostalInfo> postal_list;
00643 postal_list = cmd->get_common_data().get_postal_info();
00644 for (int i = 0; i < (int) postal_list.size(); i++) {
00645 SheppPrint::postal_info(postal_list[i]);
00646 }
00647
00648 if (cmd->get_common_data().get_voice().number != "") {
00649 printf(" voice:");
00650 SheppPrint::phone(cmd->get_common_data().get_voice());
00651 }
00652
00653 if (cmd->get_common_data().get_fax().number != "") {
00654 printf(" fax :");
00655 SheppPrint::phone(cmd->get_common_data().get_fax());
00656 }
00657
00658 if (cmd->get_common_data().get_email() != "") {
00659 printf(" email: [%s]\n", cmd->get_common_data().get_email().c_str());
00660 }
00661
00662 if (cmd->get_authInfo().get_pw() != "") {
00663 SheppPrint::authInfo(cmd->get_authInfo());
00664 }
00665
00666 if (cmd->get_common_data().get_disclose().is_set()) {
00667 SheppPrint::disclose(cmd->get_common_data().get_disclose());
00668 }
00669
00670
00671 if (cmd->get_organization() != "") {
00672 printf(" orgid: [%s]\n", cmd->get_organization().c_str());
00673
00674 map<string, string, less<string> > contacts =
00675 cmd->get_contact_list_add();
00676 map<string, string, less<string> >::const_iterator c_it;
00677 for (c_it = contacts.begin(); c_it != contacts.end(); c_it++) {
00678 printf(" contact to add [%s] = [%s]\n", (*c_it).first.c_str(),
00679 (*c_it).second.c_str());
00680 }
00681
00682 contacts = cmd->get_contact_list_rem();
00683 for (c_it = contacts.begin(); c_it != contacts.end(); c_it++) {
00684 printf(" contact to rem [%s] = [%s]\n", (*c_it).first.c_str(),
00685 (*c_it).second.c_str());
00686 }
00687 }
00688 }
00689
00690 if (process_action(act) != 0) {
00691 return -1;
00692 }
00693
00694 return 0;
00695 }
00696
00698
00702 int cmd_brorg(vector<string> &args)
00703 {
00704
00705 if (!args.empty() && !(args[0] == "help")) {
00706 if (args[0] == "check") {
00707 args.erase(args.begin());
00708 return cmd_brorg_check(args);
00709 } else if (args[0] == "info") {
00710 args.erase(args.begin());
00711 return cmd_brorg_info(args);
00712 } else if (args[0] == "transfer") {
00713 args.erase(args.begin());
00714 return cmd_brorg_transfer(args);
00715 } else if (args[0] == "create") {
00716 args.erase(args.begin());
00717 return cmd_brorg_create(args);
00718 } else if (args[0] == "delete") {
00719 args.erase(args.begin());
00720 return cmd_brorg_delete(args);
00721 } else if (args[0] == "renew") {
00722 args.erase(args.begin());
00723 return cmd_brorg_renew(args);
00724 } else if (args[0] == "update") {
00725 args.erase(args.begin());
00726 return cmd_brorg_update(args);
00727 } else {
00728 return cmd_brorg_help("invalid command: brorg " + args[0]);
00729 }
00730 }
00731
00732 return cmd_brorg_help("");
00733 }
00734
00735 #endif //__BRORG_FUNCTIONS_H__