Skip to content

Commit 2cead30

Browse files
authored
deprecating clib-* plugins (#244)
* deprecating clib-* plugins * Deprecating clib-* plugins
1 parent c388648 commit 2cead30

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/clib.c

+18
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,22 @@ static void notify_new_release(void) {
113113
free((void *)marker_file_path);
114114
}
115115

116+
static void warn_deprecated_sub_command(const char *cmd) {
117+
const char *allowed[] = {"build", "configure", "init", "install",
118+
"search", "update", "upgrade", "uninstall", NULL};
119+
120+
int i = 0;
121+
122+
do {
123+
if (0 == strcmp(allowed[i], cmd)) {
124+
return;
125+
}
126+
} while (NULL != allowed[++i]);
127+
128+
logger_warn("deprecated", "Invoking external clib-* executables as "
129+
"sub-commands will be removed in 3.0");
130+
}
131+
116132
int main(int argc, const char **argv) {
117133

118134
char *cmd = NULL;
@@ -177,6 +193,8 @@ int main(int argc, const char **argv) {
177193
cmd = strcmp(cmd, "i") == 0 ? strdup("install") : cmd;
178194
cmd = strcmp(cmd, "up") == 0 ? strdup("update") : cmd;
179195

196+
warn_deprecated_sub_command(cmd);
197+
180198
#ifdef _WIN32
181199
format(&command, "clib-%s.exe", cmd);
182200
#else

0 commit comments

Comments
 (0)