| 517 | |
| 518 | |
| 519 | static Switches::in_sw_tab_t* findSwitchOrThrow(Firebird::UtilSvc* uSvc, Switches& switches, Firebird::string& sw) |
| 520 | { |
| 521 | /************************************** |
| 522 | * |
| 523 | * f i n d S w i t c h O r T h r o w |
| 524 | * |
| 525 | ************************************** |
| 526 | * |
| 527 | * Functional description |
| 528 | * Returns pointer to in_sw_tab entry for current switch |
| 529 | * If not a switch, returns 0. |
| 530 | * If no match, throws. |
| 531 | * |
| 532 | **************************************/ |
| 533 | bool invalid = false; |
| 534 | Switches::in_sw_tab_t* rc = switches.findSwitchMod(sw, &invalid); |
| 535 | if (rc) |
| 536 | return rc; |
| 537 | |
| 538 | if (invalid) |
| 539 | { |
| 540 | if (! uSvc->isService()) |
| 541 | { |
| 542 | BURP_print(true, 137, sw.c_str()); |
| 543 | // msg 137 unknown switch %s |
| 544 | burp_usage(switches); |
| 545 | BURP_error(1, true); |
| 546 | // msg 1: found unknown switch |
| 547 | } |
| 548 | else |
| 549 | { |
| 550 | BURP_error(137, true, sw.c_str()); |
| 551 | // msg 137 unknown switch %s |
| 552 | } |
| 553 | } |
| 554 | |
| 555 | return NULL; |
| 556 | } |
| 557 | |
| 558 | |
| 559 | int gbak(Firebird::UtilSvc* uSvc) |
no test coverage detected