MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / findSwitchOrThrow

Function findSwitchOrThrow

src/burp/burp.cpp:519–556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517
518
519static 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
559int gbak(Firebird::UtilSvc* uSvc)

Callers 1

gbakFunction · 0.85

Calls 6

BURP_printFunction · 0.85
burp_usageFunction · 0.85
BURP_errorFunction · 0.85
findSwitchModMethod · 0.80
isServiceMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected