Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecating clib-* plugins #244

Merged
merged 2 commits into from
Jan 22, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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", 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