MCPcopy Create free account
hub / github.com/duckdb/duckdb / FindColorGroup

Function FindColorGroup

tools/shell/shell_metadata_command.cpp:640–654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

638}
639
640idx_t FindColorGroup(const vector<vector<string>> &groups, const string &name) {
641 optional_idx group_idx;
642 for (idx_t grp_idx = 0; grp_idx < groups.size(); grp_idx++) {
643 for (auto &group_name : groups[grp_idx]) {
644 if (StringUtil::Contains(name, group_name)) {
645 group_idx = grp_idx;
646 break;
647 }
648 }
649 }
650 if (!group_idx.IsValid()) {
651 throw InternalException("Color %s does not have a group", name);
652 }
653 return group_idx.GetIndex();
654}
655
656MetadataResult DisplayColors(ShellState &state, const vector<string> &args) {
657 bool bold = false;

Callers 1

DisplayColorsFunction · 0.85

Calls 5

ContainsFunction · 0.85
InternalExceptionClass · 0.85
sizeMethod · 0.45
IsValidMethod · 0.45
GetIndexMethod · 0.45

Tested by

no test coverage detected