Skip to content

Commit

Permalink
deprecating clib-* plugins (#244)
Browse files Browse the repository at this point in the history
* deprecating clib-* plugins

* Deprecating clib-* plugins
  • Loading branch information
Isty001 authored Jan 22, 2021
1 parent c388648 commit 2cead30
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/clib.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,22 @@ static void notify_new_release(void) {
free((void *)marker_file_path);
}

static void warn_deprecated_sub_command(const char *cmd) {
const char *allowed[] = {"build", "configure", "init", "install",
"search", "update", "upgrade", "uninstall", NULL};

int i = 0;

do {
if (0 == strcmp(allowed[i], cmd)) {
return;
}
} while (NULL != allowed[++i]);

logger_warn("deprecated", "Invoking external clib-* executables as "
"sub-commands will be removed in 3.0");
}

int main(int argc, const char **argv) {

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

warn_deprecated_sub_command(cmd);

#ifdef _WIN32
format(&command, "clib-%s.exe", cmd);
#else
Expand Down

0 comments on commit 2cead30

Please sign in to comment.