Skip to content

Commit 90aa913

Browse files
committed
Allow calling MMseqs2 modules with base: prefix to enable inheriting software to find shadowed modules
E.g. Foldseek can find MMseqs2's own createdb with foldseek base:createdb
1 parent df77d9e commit 90aa913

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/commons/Application.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@ Command *getCommandByName(const char *s) {
2727
if (!strcmp(s, p.cmd))
2828
return &p;
2929
}
30+
31+
// allow base commands also to be called with a prefix, e.g. "mmseqs base:createdb"
32+
// this allows inheriting programs to find shadowed base modules
33+
const char *prefix = "base:";
34+
const char *check = strncmp(s, prefix, strlen(prefix)) == 0 ? s + strlen(prefix) : s;
3035
for (size_t i = 0; i < baseCommands.size(); i++) {
3136
Command &p = baseCommands[i];
32-
if (!strcmp(s, p.cmd))
37+
if (!strcmp(check, p.cmd))
3338
return &p;
3439
}
3540
return NULL;

0 commit comments

Comments
 (0)